March 12, 2014 at 10:25 pm
Hi,
Is there any difference between those 2 way to handle intermediate results, I know that before 2008 it made difference in terms of locks during the whole execution of
insert into #t from myt
but I heard that after 2008 it's being takec care of so it doesn't matter you do SELECT INTO #T FROM MYT
or
CREATE @T TABLE, INSERT @T SELECT FROM MYT
Thanks
Mario
davai
March 12, 2014 at 11:39 pm
Although it's a bit dated, I still consider the following article to be one of the best on the subject of Temp Tables vs Table Variables.
http://www.sqlservercentral.com/articles/Temporary+Tables/66720/
My personal feeling, especially when it comes to ease of troubleshooting, is that I won't use Table Variables anywhere except in functions and that's only because Temp Tables don't work in functions. There will be differing opinions on that but that's my opinion. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply