Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by Nakul Vachhrajani
»
Fun with IDENTITY - Part II
28 posts, Page 1 of 3
1
2
3
»
»»
Fun with IDENTITY - Part II
Rate Topic
Display Mode
Topic Options
Author
Message
Nakul Vachhrajani
Nakul Vachhrajani
Posted Tuesday, October 05, 2010 8:46 PM
Ten Centuries
Group: General Forum Members
Last Login: Thursday, May 16, 2013 9:52 AM
Points: 1,277,
Visits: 1,608
Comments posted to this topic are about the item
Fun with IDENTITY - Part II
Thanks & Regards,
Nakul Vachhrajani.
http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx
Be courteous. Drive responsibly.
Follow me on
Twitter:
@nakulv_sql
Google Plus:
+Nakul
Post #998910
UMG Developer
UMG Developer
Posted Tuesday, October 05, 2010 10:39 PM
SSCrazy
Group: General Forum Members
Last Login: Monday, May 13, 2013 11:21 AM
Points: 2,163,
Visits: 2,148
Nice question, thanks!
Related BOL links:
SQL Server 2008 R2:
http://msdn.microsoft.com/en-us/library/ms175010.aspx
SQL Server 2008:
http://msdn.microsoft.com/en-us/library/ms175010(SQL.100).aspx
SQL Server 2005:
http://msdn.microsoft.com/en-us/library/ms175010(SQL.90).aspx
SQL Server 2000:
http://msdn.microsoft.com/en-us/library/aa260638(SQL.80).aspx
All of them say:
* "Transactions involving table variables last only for the duration of an update on the table variable. Therefore, table variables require less locking and logging resources."
* "... because table variables have limited scope and are not part of the persistent database, they are not impacted by transaction rollbacks."
I think that pretty much says that table variables don't fully participate in transactions, and can't be rolled back. (I was expecting to find something that said
variables
don't participate in transactions, but I never found that.)
Post #998940
Dhruvesh Shah
Dhruvesh Shah
Posted Tuesday, October 05, 2010 11:01 PM
Mr or Mrs. 500
Group: General Forum Members
Last Login: Wednesday, July 25, 2012 9:04 PM
Points: 542,
Visits: 187
Good Question.
I found this link on google which explains it bit more in details
http://www.sql-server-performance.com/articles/per/temp_tables_vs_variables_p1.aspx
Post #998950
Nakul Vachhrajani
Nakul Vachhrajani
Posted Tuesday, October 05, 2010 11:18 PM
Ten Centuries
Group: General Forum Members
Last Login: Thursday, May 16, 2013 9:52 AM
Points: 1,277,
Visits: 1,608
UMG Developer (10/5/2010)
Nice question, thanks!
Related BOL links:
SQL Server 2008 R2:
http://msdn.microsoft.com/en-us/library/ms175010.aspx
SQL Server 2008:
http://msdn.microsoft.com/en-us/library/ms175010(SQL.100).aspx
SQL Server 2005:
http://msdn.microsoft.com/en-us/library/ms175010(SQL.90).aspx
SQL Server 2000:
http://msdn.microsoft.com/en-us/library/aa260638(SQL.80).aspx
All of them say:
* "Transactions involving table variables last only for the duration of an update on the table variable. Therefore, table variables require less locking and logging resources."
* "... because table variables have limited scope and are not part of the persistent database, they are not impacted by transaction rollbacks."
I think that pretty much says that table variables don't fully participate in transactions, and can't be rolled back. (I was expecting to find something that said
variables
don't participate in transactions, but I never found that.)
Thanks for your support and providing the great links.
I believe I could not get the supporting documentation for this question because I was looking for a reference to the fact that "
variables
don't participate in transactions"
Thanks & Regards,
Nakul Vachhrajani.
http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx
Be courteous. Drive responsibly.
Follow me on
Twitter:
@nakulv_sql
Google Plus:
+Nakul
Post #998960
manjul.dube
manjul.dube
Posted Tuesday, October 05, 2010 11:36 PM
Grasshopper
Group: General Forum Members
Last Login: Wednesday, October 06, 2010 5:13 AM
Points: 19,
Visits: 3
Good Question.. thanks
Post #998968
Hardy21
Hardy21
Posted Wednesday, October 06, 2010 12:24 AM
SSC Eights!
Group: General Forum Members
Last Login: Monday, May 13, 2013 2:42 PM
Points: 877,
Visits: 1,158
Thanks 'UMG Developer' for reference links & Nakul for good question.
Thanks
Post #998999
Koen Verbeeck
Koen Verbeeck
Posted Wednesday, October 06, 2010 12:27 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Today @ 1:52 AM
Points: 9,372,
Visits: 6,469
Great question! Definately learned something today.
How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
Member of
LinkedIn
. My blog at
LessThanDot
.
MCSA SQL Server 2012 - MCSE Business Intelligence
Post #999000
larsts
larsts
Posted Wednesday, October 06, 2010 2:28 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 7:57 AM
Points: 173,
Visits: 101
Good question!
Post #999052
Michael Riemer
Michael Riemer
Posted Wednesday, October 06, 2010 3:11 AM
Ten Centuries
Group: General Forum Members
Last Login: Thursday, May 16, 2013 2:10 AM
Points: 1,237,
Visits: 346
Great question and thanks for the reference documentation. Nearly missed the fact that you were loading a table variable!!!
It is something I have used myself on occasions to manage logging, if we do a standard rollback, the logging is rolled back as well, so tracing records was impossible unless we logged to a table variable in the transaction. Once the transaction is rolled back or commited, the logging is stored into a fixed table.
Post #999073
COOL_ICE
COOL_ICE
Posted Wednesday, October 06, 2010 3:31 AM
Old Hand
Group: General Forum Members
Last Login: 2 days ago @ 4:17 AM
Points: 350,
Visits: 425
I got it worng no dought it is a good question
- SAMJI
If you marry one they will fight with you, If you marry 2 they will fight for you
Post #999085
« Prev Topic
|
Next Topic »
28 posts, Page 1 of 3
1
2
3
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.