<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Crafting software&#187; MSSQL</title>
	<atom:link href="http://davidlaing.com/category/platforms/mssql/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidlaing.com</link>
	<description>David Laing&#039;s thoughts on software development</description>
	<lastBuildDate>Wed, 01 Feb 2012 11:02:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Try/Catch for SQL!?</title>
		<link>http://davidlaing.com/2009/03/05/trycatch-for-sql/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=trycatch-for-sql</link>
		<comments>http://davidlaing.com/2009/03/05/trycatch-for-sql/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 11:42:05 +0000</pubDate>
		<dc:creator>mrdavidlaing</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://davidlaing.com/?p=167</guid>
		<description><![CDATA[Thanks to Nick Sertis for this trick &#8211; who knew TSQL could do try/catch statements! Very useful when you need to write data manipulation scripts for production databases. BEGIN TRY BEGIN TRAN --Some SQL COMMIT TRAN END TRY -- Catch the errors on the inserts BEGIN CATCH ROLLBACK TRAN SELECT ERROR_MESSAGE() END CATCH]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://www.sertis.net">Nick Sertis</a> for this trick &#8211; who knew TSQL could do try/catch statements!</p>
<p>Very useful when you need to write data manipulation scripts for production databases.</p>
<pre>
BEGIN TRY

    BEGIN TRAN

        --Some SQL

    COMMIT TRAN

END TRY
-- Catch the errors on the inserts
BEGIN CATCH

    ROLLBACK TRAN
    SELECT ERROR_MESSAGE()

END CATCH
</pre>
]]></content:encoded>
			<wfw:commentRss>http://davidlaing.com/2009/03/05/trycatch-for-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

