<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: T-SQL/SSMS: transaction rollback in scripts with XACT_ABORT ON, GO statements and syntax errors	</title>
	<atom:link href="https://www.codejourney.net/t-sqlssms-transaction-rollback-in-scripts-with-xact_abort-on-go-statements-and-syntax-errors/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codejourney.net/t-sqlssms-transaction-rollback-in-scripts-with-xact_abort-on-go-statements-and-syntax-errors/</link>
	<description>Become a better .NET full stack web developer</description>
	<lastBuildDate>Sat, 17 Nov 2018 12:37:16 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>
		By: Anonymous		</title>
		<link>https://www.codejourney.net/t-sqlssms-transaction-rollback-in-scripts-with-xact_abort-on-go-statements-and-syntax-errors/#comment-79</link>

		<dc:creator><![CDATA[Anonymous]]></dc:creator>
		<pubDate>Fri, 17 Nov 2017 19:57:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsibinski.pl/?p=2425#comment-79</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.codejourney.net/t-sqlssms-transaction-rollback-in-scripts-with-xact_abort-on-go-statements-and-syntax-errors/#comment-78&quot;&gt;Dawid Sibiński&lt;/a&gt;.

If I remember correctly, the problem with this EXEC/version was that people forgot to add a GO at the end of the stored procedure that was just above the EXEC/version statement, and therefore it became part of the stored procedure itself.

One quick way to fix it would be to retrieve the current pre-execution of the script and compare it with the version post-execution. If they are the same, then it means that either something went wrong or someone didn&#039;t properly version their script.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.codejourney.net/t-sqlssms-transaction-rollback-in-scripts-with-xact_abort-on-go-statements-and-syntax-errors/#comment-78">Dawid Sibiński</a>.</p>
<p>If I remember correctly, the problem with this EXEC/version was that people forgot to add a GO at the end of the stored procedure that was just above the EXEC/version statement, and therefore it became part of the stored procedure itself.</p>
<p>One quick way to fix it would be to retrieve the current pre-execution of the script and compare it with the version post-execution. If they are the same, then it means that either something went wrong or someone didn&#8217;t properly version their script.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dawid Sibiński		</title>
		<link>https://www.codejourney.net/t-sqlssms-transaction-rollback-in-scripts-with-xact_abort-on-go-statements-and-syntax-errors/#comment-78</link>

		<dc:creator><![CDATA[Dawid Sibiński]]></dc:creator>
		<pubDate>Fri, 17 Nov 2017 19:04:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsibinski.pl/?p=2425#comment-78</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.codejourney.net/t-sqlssms-transaction-rollback-in-scripts-with-xact_abort-on-go-statements-and-syntax-errors/#comment-77&quot;&gt;Youenn&lt;/a&gt;.

Well, yeah, in most cases it is detected on test database. What&#039;s more, a programmer who prepares the script should *normally* not commit to source control any script with syntax errors (so it should be tested on his local db even before the test one). The probability is relatively low, but it depends what you put in the scripts. 
In our case, as you may know ;), at the end of each script there is an EXEC statement responsible for setting script-related functionality&#039;s version on the database. Many scripts may be executed by some external application (e.g. sqlcmd or C# code) and this issue (or its consequences) may be hard to notice/detect sometimes even on local/test db.

It just surprised me I couldn&#039;t find any other &quot;T-SQL solution&quot; for that.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.codejourney.net/t-sqlssms-transaction-rollback-in-scripts-with-xact_abort-on-go-statements-and-syntax-errors/#comment-77">Youenn</a>.</p>
<p>Well, yeah, in most cases it is detected on test database. What&#8217;s more, a programmer who prepares the script should *normally* not commit to source control any script with syntax errors (so it should be tested on his local db even before the test one). The probability is relatively low, but it depends what you put in the scripts.<br />
In our case, as you may know ;), at the end of each script there is an EXEC statement responsible for setting script-related functionality&#8217;s version on the database. Many scripts may be executed by some external application (e.g. sqlcmd or C# code) and this issue (or its consequences) may be hard to notice/detect sometimes even on local/test db.</p>
<p>It just surprised me I couldn&#8217;t find any other &#8220;T-SQL solution&#8221; for that.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Youenn		</title>
		<link>https://www.codejourney.net/t-sqlssms-transaction-rollback-in-scripts-with-xact_abort-on-go-statements-and-syntax-errors/#comment-77</link>

		<dc:creator><![CDATA[Youenn]]></dc:creator>
		<pubDate>Fri, 17 Nov 2017 18:38:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsibinski.pl/?p=2425#comment-77</guid>

					<description><![CDATA[Cool article, I remember having the exact same issue a few years ago. A simpler solution would be to first run your script on a test database and catch any syntax error there :)]]></description>
			<content:encoded><![CDATA[<p>Cool article, I remember having the exact same issue a few years ago. A simpler solution would be to first run your script on a test database and catch any syntax error there 🙂</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
