November 15, 2016 at 10:07 pm
Comments posted to this topic are about the item Temp tables in transaction
_____________
Code for TallyGenerator
November 16, 2016 at 12:10 am
This was removed by the editor as SPAM
November 16, 2016 at 1:23 am
A good reminder QotD. Thanks.
Igor Micev,My blog: www.igormicev.com
November 16, 2016 at 5:25 am
Good question, Sergiy. Thanks.
November 16, 2016 at 6:57 am
Thanks for the question.
November 16, 2016 at 8:39 am
Nice straight forward question Sergiy. And something that many people don't know.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 16, 2016 at 9:56 am
Good QotD. Someone not knowing this could introduce a serious bug into their work.
----------------------------------------------------
November 16, 2016 at 11:27 am
There are all kinds of interesting tidbits about table variables and temp tables. Wayne Sheffield has a great presentation on them that I really enjoyed. I'd recommend attending if anyone gets an opportunity.
November 16, 2016 at 3:52 pm
Very good, Sergiy - thanks you!
November 16, 2016 at 8:01 pm
Thanks everyone for positive feedbacks.
For myself I use a simple rule of thumb here:
table is a table, even if it's a temporary one, and within transactions it acts as a table;
variable is a variable, even if it's a table type one, and within transactions it acts as all variables.
_____________
Code for TallyGenerator
November 18, 2016 at 12:33 pm
Nice question. And I like that simple rule of thumb.
Managed to get it wrong by clicking as I pushed the mouse up the screen and timed the click wrong. I must be getting old and decrepit or something, obviously that sort of slip could lose a life in games that I used to play when I was much younger.
Tom
November 19, 2016 at 5:13 am
Hy Sergiy,
I performed this code on SQL Server 2016 Express and result show the both tables dont have records.
Please test this code on SQL Server 2016 Express.
November 22, 2016 at 3:06 am
Nice question, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply