Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dwentzel
SQLScripts
Commits
c8b8381b
Commit
c8b8381b
authored
Dec 02, 2014
by
dwentzel
Browse files
changes
parent
f688d87c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Transactions/010_transaction_names.sql
View file @
c8b8381b
SET
NOCOUNT
ON
/*
According to BOL (http://msdn.microsoft.com/en-us/library/ms188929.aspx) named transactions
must adhere to the rules for identifiers, except names will be truncated at 32 characters.
...
...
Transactions/011_transaction_names.sql
View file @
c8b8381b
SET
NOCOUNT
ON
/*
According to BOL (http://msdn.microsoft.com/en-us/library/ms188929.aspx) named transactions
must adhere to the rules for identifiers, except names will be truncated at 32 characters.
...
...
Transactions/030_implicit_tx.sql
View file @
c8b8381b
SET
NOCOUNT
ON
/*
In this example SQL Server will help you if you mismatch your BEGIN and COMMIT TRAN statements.
...
...
@@ -7,8 +8,8 @@
But this behavior does not work when using implicit transactions
Demo:
1)EXEC Wrapper 1 with implicit_transactions OFF...note that Error 266 is thrown
2)EXEC Wrapper 0 with implicit_transactions OFF...note that Error 266 is thrown
1)EXEC Wrapper 1 with implicit_transactions OFF...note that Error 266 is thrown
, transaction "dangled"
2)EXEC Wrapper 0 with implicit_transactions OFF...note that Error 266 is thrown
, transaction rolled back
3)EXEC Wrapper 0 with implicit_transactions ON...Error 3902 occurs in Wrapper Procedure
3)EXEC Wrapper 1 with implicit_transactions ON...in this case no error is thrown and we "dangled" a transaction
...
...
Transactions/031_implicit_tx.sql
View file @
c8b8381b
...
...
@@ -9,7 +9,7 @@
Demo:
1)Error: "BatchProcessing cannot be called in the context of an open transaction"
2)Even with SET IMPLICIT_TRANSACTIONS ON everything works correctly. (Line
63-64
)
2)Even with SET IMPLICIT_TRANSACTIONS ON everything works correctly. (Line
70
)
3)But does not function correctly without the wrapper (Line 70-71). Note that we have 2
transactions.
...
...
Transactions/033_implicit_tx.sql
View file @
c8b8381b
SET
NOCOUNT
ON
/*
This further demos how to check if you are running under
implicit transactions (IT) and some of the consequences
...
...
Transactions/FunWithTransactions.pptx
View file @
c8b8381b
No preview for this file type
Transactions/README.MD
View file @
c8b8381b
Transaction Trivia
======================
Did you ever notice that sp_reset_connection is called A LOT?
Did you ever see an "orphaned spid" with an open transaction that caused you massive blocking?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment