Viewing 15 posts - 8,101 through 8,115 (of 8,416 total)
Grant Fritchey (4/30/2009)
April 30, 2009 at 7:36 pm
Consider makling the INSERT and EXISTS test the same statement:
INSERT dbo.Table (...columns..)
SELECT @primary_key_value, ...other columns
WHERE NOT EXISTS
(
SELECT 1 FROM dbo.Table
WHERE dbo.Table.primary_key_column = @primary_key_value
)
Make sure you have a primary key on...
April 30, 2009 at 7:23 pm
Also, the behaviour is the same when executed alternately from different connections, even with different SET options, and different user ids- the allocated pages stored with the plan are re-used...
April 30, 2009 at 7:09 pm
GilaMonster (4/30/2009)
WayneS (4/30/2009)
Gail - can you give a good answer to this?
Offhand, no, but I suspect it has something to do with Statement level recompile and/or temp table caching....
April 30, 2009 at 6:58 pm
Tim,
You should use the event SQL:StmtRecompile instead of SP:Recompile in 2005 and later.
See http://msdn.microsoft.com/en-us/library/ms179294.aspx
The SP:Recompile event is there to allow tracing of SQL2K instances.
Anyway, on to the answer:
SQL2K5 caches...
April 30, 2009 at 6:56 pm
John,
Good point - I feel as though I was harsh now.
However, I suspect that expecting behaviour to change simply by deleting a comment is the same in any language 😉
Paul
April 30, 2009 at 4:40 pm
GilaMonster (4/30/2009)
Please. I can read your code from the other side of the room at the moment.
At least that gives you freedom to roam about while on the forum? :laugh:
Ok...
April 30, 2009 at 4:29 pm
You could have a SQL Agent job that goes around creating the appropriate linked servers for you, I have seen that approach taken before.
I tend to agree with Flo though...
April 30, 2009 at 4:27 pm
RBarryYoung (4/30/2009)
April 30, 2009 at 4:24 pm
RBarryYoung (4/30/2009)
Still, it's always bothered...
April 30, 2009 at 4:21 pm
TheSQLGuru (4/30/2009)
April 30, 2009 at 3:58 pm
Florian Reischl (4/30/2009)
New non off topic for this thread...
:laugh:
Saw that yesterday and figured Steve had sorted it. He's a braver man than I.
Seems I underestimated the OP.
Ho hum.
Paul
April 30, 2009 at 3:55 pm
Hmm. That blunted the intended impact somewhat :doze:
Fixed now - I must not put underline tags inside the url tags it seems!
Thanks everyone for letting me know.
Paul
April 30, 2009 at 3:50 pm
I used:
Insert Into dbo.Users (UserName, LastLoggedIn)
SELECT TOP 40000 CHAR(65+FLOOR(RAND(a.column_id*801020 + a.column_id*705020)*12)) + CHAR(65+FLOOR(RAND(a.column_id*6010 + b.object_id)*5)), DATEADD(dd,RAND(a.column_id*600 + b.object_id/1.5)*500,'2008/01/01')
FROM master.sys.columns a CROSS JOIN master.sys.columns b
from a previous post...was that yours? ...
April 30, 2009 at 3:40 pm
Viewing 15 posts - 8,101 through 8,115 (of 8,416 total)