Viewing 15 posts - 49,321 through 49,335 (of 49,552 total)
Triggers should be as small as possible. I shudder at the thought of anythihng (especially a trigger) that requires that many variables.
> is it the right way to programm the...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 15, 2005 at 6:24 am
Why are you using a cursor? ![]()
UPDATE #Sales
SET sQty = Agg.qty, Jan=Agg.jan, Feb=Agg.feb
FROM (SELECT
product,
SUM(qty) AS qty,
SUM(CASE WHEN MONTH(invoice_date) =...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 15, 2005 at 5:46 am
This should work. It will always return
Cat Pet
Jack Owner
SELECT Min(Name), Type FROM tbl GROUP BY Type
You can use Max and that'll return John and Monkey
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 14, 2005 at 12:00 am
Do you have AWE switched on? What's sql's memory settings? Dynamic or fixed maximum?
What's the CPU utilisation like? Disk IOs? Network card queue length?
Locking? Index usage vs table scans?
There's a...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 13, 2005 at 11:39 pm
If the ids are plain numeric, define the id column on the new table as an identity and don't put any values into it. SQL will assign identity values automatically...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 9, 2005 at 11:48 pm
No, but users do enter values.
eg. User selects to filter on company code and lists companies 'ABC123','DEF789','XYZ000'
or, he selects company name and would like to do a wildcard match for...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 9, 2005 at 11:02 pm
OK, a few things that maybe weren't clear.
I'm rewriting this proc because it's a performance hog. I didn't write the code in the first place. I hate cursors.
The app's a...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 8, 2005 at 11:39 pm
Another example is the JobHistory table in the msdb database where the job start datetime is in two columns: "date" is recorded as an integer and "time" is a seperate...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 4, 2005 at 6:35 am
Personally I'd suggest converting the time into seconds and storing as number of seconds. It can be converted back to hh:mm:ss for display purposes easily enough
SELECT CAST(SUBSTRING(WCVideoAmount,1,2) As INT)*3600 +...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 4, 2005 at 12:50 am
I don't know why you're using a subquery for this...
SELECT itaps_users.username, itaps_users.id, itaps_rights.RAENID
FROM itaps_users INNER JOIN itaps_rights on itaps_users.id=itaps_rights.userID
WHERE itaps_rights.RAENID=3
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 3, 2005 at 11:54 pm
I don't think so.
The UMS relies on threads been cooperative - voluntarily yielding the processor to another thread.
The windows scheduler doesn't rely on any behaviour from the thread but...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 3, 2005 at 11:04 pm
Has someone perhaps put a trigger on the table?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 2, 2005 at 12:50 am
CREATE TABLE #Temp (
... -- columns matching output of stored proc
)
INSERT INTO #Temp
EXEC StoredProcedure @Params ...
The limitation is that the stored proc must return only one reordset.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 1, 2005 at 11:48 pm
Generated at runtime, as far as I know. Makes sense, since sps can return completely different resultsets for different callings.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 28, 2005 at 2:13 am
Thanks for the comments. I'm leaning towards 70-290. I'll probably do 291 at a later date.
Yelena: you're right, I don't work for a small company. I work for the corperate...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 28, 2005 at 1:15 am
Viewing 15 posts - 49,321 through 49,335 (of 49,552 total)