﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Raj Vasant / Article Discussions / Article Discussions by Author  / Exception Handling in SQL Server 2005 / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 20 Jun 2013 00:37:53 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Exception Handling in SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic248571-227-1.aspx</link><description>Hi,         I have a question, can i execute a insert query inside the catch block?Regards,Arafath.</description><pubDate>Tue, 15 Jul 2008 06:03:05 GMT</pubDate><dc:creator>arafath</dc:creator></item><item><title>RE: Exception Handling in SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic248571-227-1.aspx</link><description>Can someone direct me to where I can find a list of all the errorcodes returned by 'ERROR_NUMBER()' inside a stored procedure?Thanks.Ashley</description><pubDate>Wed, 16 Apr 2008 10:37:22 GMT</pubDate><dc:creator>Anthony Rogers</dc:creator></item><item><title>RE: Exception Handling in SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic248571-227-1.aspx</link><description>oops... sorry... a mistake...XACT_STATE states are 0,1 and -1 as you mentioned...I used XACT_STATE in some examples and while checking for state 1, i had the condition XACT_STATE &gt;= 1 on my mind. I m updating my replyThnx.. &lt;img src='images/emotions/smile.gif' height='20' width='20' border='0' title='Smile' align='absmiddle'&gt;</description><pubDate>Thu, 02 Feb 2006 21:46:00 GMT</pubDate><dc:creator>Vasant Raj</dc:creator></item><item><title>RE: Exception Handling in SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic248571-227-1.aspx</link><description>&lt;P&gt;Just curious as to the overhead to use Try/Catch within TSQL / stored procedure.&lt;/P&gt;&lt;P&gt;I'm assuming this is using the CLR and if you put this within a high volume, repeatedly used sproc, the performance hit involved?&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Thu, 02 Feb 2006 07:28:00 GMT</pubDate><dc:creator>Tim OPry</dc:creator></item><item><title>RE: Exception Handling in SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic248571-227-1.aspx</link><description>Thank you very much for replying, but according to my BOL it has -1, 0 and 1 as values. Where do you get your 0,1,2 values from? TIAHenrik</description><pubDate>Thu, 02 Feb 2006 06:45:00 GMT</pubDate><dc:creator>henrik staun poulsen</dc:creator></item><item><title>RE: Exception Handling in SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic248571-227-1.aspx</link><description>XACT_STATE has 3 possible values.0 = there is no transaction1 = Transaction can be committed-1 =  Transaction should be rolled back.So, if your try-catch block needs to maintain TRANSACTIONs then your CATCH block should check for (XACT_STATE()) = -1 rolling back your transaction. You can start checking the condition (XACT_STATE()) &lt;&gt; 0 in your CATCH block.</description><pubDate>Thu, 02 Feb 2006 03:27:00 GMT</pubDate><dc:creator>Vasant Raj</dc:creator></item><item><title>RE: Exception Handling in SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic248571-227-1.aspx</link><description>Great article, but I think you forget one thing:What about xact_state() ?I've seen somewhere (might have been BOL) that this code should work:if (XAXT_State()) = -1 RollBack TransactionBut I'm uncertain if I should add it to all my try-catch blocks. What do you think?</description><pubDate>Thu, 02 Feb 2006 01:27:00 GMT</pubDate><dc:creator>henrik staun poulsen</dc:creator></item><item><title>Exception Handling in SQL Server 2005</title><link>http://www.sqlservercentral.com/Forums/Topic248571-227-1.aspx</link><description>Comments posted to this topic are about the content posted at &lt;A HREF="http://www.sqlservercentral.com/columnists/rVasant/exceptionhandlinginsqlserver2005.asp"&gt;http://www.sqlservercentral.com/columnists/rVasant/exceptionhandlinginsqlserver2005.asp&lt;/A&gt;</description><pubDate>Thu, 05 Jan 2006 11:33:00 GMT</pubDate><dc:creator>Vasant Raj</dc:creator></item></channel></rss>