Skip to main content

All Questions

0 votes
0 answers
1k views

SQL Server : restrict database access only to specific user login

I have an odd situation where I ran this query to see how many connections are opened towards my database, and I found out this: SELECT DB_NAME(dbid) as DBName, COUNT(dbid) as 'Number Of ...
User987's user avatar
  • 3,773
0 votes
1 answer
71 views

SELECT statement takes hours to execute

I'm trying to run this SELECT statement but I takes hours to execute. I have also created index on those tables. SELECT DISTINCT j.Name AS State, l.DisplayName AS ServiceCenter, l....
ALE's user avatar
  • 5
5 votes
1 answer
986 views

SQL Using a String Function on Indexed Column Performance

I have a general question regarding using String Functions and their impact on performance. I have a table with a non-clustered index on column ID. The column has 20 digit varchar in it. When I run :...
jmich738's user avatar
  • 1,635
1 vote
0 answers
19 views

trigger performance over different cases

I have a table that collects logs of every check_in. I want to pick 4 columns to later process them. I have placed a trigger on every insert and columns are copied. I am confused over which way to do ...
Usman Ali Siddiqui Sabzwari's user avatar
0 votes
2 answers
584 views

SQL Query slow beginning of each day

I have a basic query below. Select [ID] FROM MyTable Where [TextBlobField] like '%test%' This query takes a long time when I first run it each day. After that it only takes about 5 seconds. Next ...
user1887198's user avatar
0 votes
1 answer
51 views

Why does query performance diminish with additional join conditions

I have a simple query with two tables. massfehler_hardware has 50K rows and no indexes. f_produkt has 38M rows with a clustered unique index on account_number, item_number, contract_number, [and some ...
ercan's user avatar
  • 1,708
1 vote
0 answers
295 views

sp_executesql select * is much faster than select column fields?

I encounter an issue where when I use sp_executesql to select * (6 seconds) is much faster than select column fields (2min). (using sql server 2005) I can't understand why the performance is so much ...
Eddie's user avatar
  • 11
1 vote
3 answers
61 views

Best indexes to create when a search may be on any or all of 3 fields

I am working on a new search function in our software where a user will be allowed to search on any or all of 3 possible fields A, B and C. I expect that if anything is entered for a field it will be ...
Robert C's user avatar
0 votes
1 answer
195 views

SQL Server 2005 : intermittently slow Inserts

I have a client app that is submitting the following command to SQL Server 2005. At a specific time of day we are having performance issues where some of the requests are taking between 2 - 8 seconds ...
user1828271's user avatar
1 vote
4 answers
167 views

Stored Procedure Takes Longer to Execute then TSQL Query in SQL Server 2005

I am very new to TSQL and stored procedures TSQL and stored procedure both uses defined variable. TSQL takes 19 seconds to get results, however stored procedure takes around 8 minutes Stored ...
Chir's user avatar
  • 21
1 vote
1 answer
48 views

How to speed up this group by with CSV column?

I have a simple table: create table breaktypes (parent_id int, child_id int). The data is basically this: parent_id child_id 125 1 125 3 125 19 125 3722 126 32 126 ...
AngryHacker's user avatar
  • 61.1k
0 votes
0 answers
240 views

What is the most efficient way to bring large amount of data from the database?

I have a stored proc that returns 7 data tables from a SQL Server in its resultset. It uses about 400 MB of bandwidth to bring the data to the client for processing. The code to bring the data ...
AngryHacker's user avatar
  • 61.1k
12 votes
1 answer
8k views

Does INNER JOIN performance depends on order of tables?

A question suddenly came to my mind while I was tuning one stored procedure. Let me ask it - I have two tables, table1 and table2. table1 contains huge data and table2 contains less data. Is there ...
Kartic's user avatar
  • 2,955
5 votes
1 answer
395 views

Why is COUNT(DISTINCT fieldA) slower than COUNT(DISTINCT LTRIM(RTRIM(UPPER(fieldA))))?

I am new to execution plans in SQL Server 2005, but this mystifies me. When I run this code ... ((SELECT COUNT(DISTINCT StudentID) FROM vwStudentUnitSchedules AS v WHERE v.UnitActive = 1 AND v....
LoftyWofty's user avatar
2 votes
3 answers
835 views

Improve performance of stored procedure where only select query is used

In our environment one procedure is taking long time to execute. I have checked the procedure, and below is the summary - The procedure contains only select block (around 24). Before each select we ...
Kartic's user avatar
  • 2,955

15 30 50 per page
1
2 3 4 5
18