Viewing 15 posts - 271 through 285 (of 508 total)
TheSQLGuru (1/24/2011)
I don't think your delay on first execution is due to compilation time. 99% of the time that extra wait occuring on first execution is because the DATA...
February 2, 2011 at 4:17 pm
What you want to do is fairly easy if you use a calendar table. Here is an article I published on the subject last July and it has an...
February 1, 2011 at 12:53 pm
Mike,
The APPLY method I suggested first would be a bit messy if you want to pivot these out. You can use the PIVOT operator, but I've had some bad...
January 31, 2011 at 7:23 pm
Gus,
You busted my chops on this one. I currently only have 1 client on 2008 so I don't actually user the MERGE statement much.
The idea of dumping the output...
January 29, 2011 at 1:42 pm
Jeff Moden
Oh... be careful, now. You simply cannot trust the execution plans 100%. The only thing you can really trust is SQL Profiler. I'll give you an example...
Good call Jeff....
January 29, 2011 at 1:30 pm
Joe,
I came up in the ranks of PDP-11 assembly language. I've used just about every text editor (including TECO) that you can imagine. The whole purpose of formatting your...
January 29, 2011 at 1:04 pm
Mike,
Another way to do this is using APPLY. In this case I don't know whether ROW_NUMBER() or APPLY would be more optimum.
SELECT NM.Name, Clr.Color
FROM Name NM
CROSS APPLY
(SELECT...
January 29, 2011 at 12:49 pm
Serge,
Just a quick note on your scalar function - fx_GetLastOdometer. This type of scalar function in a query causes hidden RBAR (Row By Agonizing Row) type processing. The...
January 29, 2011 at 12:43 pm
Chris,
Since this is a procedure rather than a view or in-line query you could also do this:
SELECT TOP (1)
{actual field list}
INTO #T
FROM {same as EXISTS statement}
WHERE {same as...
January 29, 2011 at 11:40 am
I agree with Kevin on this one, but there is one exception. If that table for some reason is a heap when it really shouldn't be a heap. ...
January 29, 2011 at 11:16 am
If the problem was in a trigger, then you probably have a problem with that trigger. A trigger should never fail due to more than 1 record being returned...
January 27, 2011 at 3:53 pm
Good one Joe. A bit beyond the scope of the question posed by the OP, but I found it enlightening. I hadn't really thought it out why you...
January 27, 2011 at 3:43 pm
pramodbr2002 26-Jan-2011 @ 7:09:25 AM
@sriram-2, I am actually populating a table variable through this query, hence wanted to get the join working.
my xml dataset is quite small, so having a...
January 27, 2011 at 3:25 pm
Another easy way to handle this is create a stored procedure for the query on the remote server. Then execute it from the local server using the 4-part procedure...
January 27, 2011 at 3:19 pm
Viewing 15 posts - 271 through 285 (of 508 total)