Viewing 15 posts - 57,241 through 57,255 (of 59,049 total)
Len, the following will prevent an index from being used if one is available...
where convert( varchar(10), DateField,112 ) between @T1 and @T2
November 9, 2006 at 9:34 pm
Papillon,
Would you post the query that makes the output, please... there may be a trick or two we can pull off on this one...
November 9, 2006 at 9:27 pm
And, be aware that because the code uses a global temp table, you should do something to guarantee that only one instance of the code will ever be executed at...
November 9, 2006 at 6:10 pm
Robert,
Shifting gears a bit, how's the performance of inserts of new records? How about for a returning customer with a new order? Your clusterd index is VERY contrary to the...
November 9, 2006 at 6:05 pm
Nope... other than moving the table as Serqiy suggested (and, is actually the correct way to do it!), the only other way is by trigger...
November 9, 2006 at 5:43 pm
I'm assuming that the proc you made from my code example creates a temp table within it... that won't work because of the scope of temp tables... you have to...
November 9, 2006 at 6:16 am
Gail,
Sorry I don't have time to modify this code snippet I borrowed from some of the production code I wrote for work... lemme give you a couple of hints...
November 8, 2006 at 11:29 pm
Really? Easier in the App? Could I see an example, please? And don't forget to report what the performance is... thanks.
November 8, 2006 at 8:56 pm
One test is worth a thousand words... run the following... do note that the AUTHOR table does NOT exist in PUBS...
USE PUBS
GO
IF OBJECT_ID('dbo.Author') IS NOT NULL --No...
November 8, 2006 at 8:53 pm
Ummm.... why don't you just store it in a variable and execute it using EXEC or sp_ExecuteSQL ???
November 7, 2006 at 7:30 am
You're missing the implied carriage returns both captured in single quotes and by the return of each line... to emphasize...
SELECT 'Hey
'+'Go'
FROM MASTER..SYSDATABASES WITH(NOLOCK)
WHERE DBID>5
November 7, 2006 at 6:02 am
It's important that it print right on the screen? Ok.. I have to ask... what are you actually doing with this? Hopefully you're not doing a cut and paste from...
November 6, 2006 at 8:49 pm
Ok... One picture is worth a thousand words...
--===== Conditionally drop the temp table
IF OBJECT_ID('TEMPDB..#Test') IS NOT NULL
DROP TABLE #Test
DECLARE @Rows INT
CREATE TABLE...
November 5, 2006 at 8:53 am
Viewing 15 posts - 57,241 through 57,255 (of 59,049 total)