Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: comp.databases.ms-sqlserver,microsoft.public.sqlserver.programming Subject: Re: SS 2008: Rethrowing User-Defined Error Codes *FULLY* Followup-To: comp.databases.ms-sqlserver Date: Fri, 13 May 2011 07:43:05 +0000 (UTC) Organization: Erland Sommarskog Lines: 28 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Date: Fri, 13 May 2011 07:43:05 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="G7+Jz22XqYCG8C6rb1H3YA"; logging-data="31768"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dJU98y4Kdfo1PZE+JOgur" User-Agent: Xnews/2005.10.03 Mime-proxy/1.4.c.4 (Win32) Cancel-Lock: sha1:xnJOS/t3rlptEG66uhsPTNWiWtc= Xref: x330-a1.tempe.blueboxinc.net comp.databases.ms-sqlserver:329 Gene Wirchenko (genew@ocis.net) writes: > Is there something that I am overlooking? Not really, I think you have summrised the alternatives quite well. What I can add is: 1) I don't like user-defined messages as they work today in SQL Server for two reasons: a) They are defined on server-level. b) Numbers are not very mnemonic. 2) Look at http://www.sommarskog.se/error_handling_2005.html which is a variation of your first alternative, but the re-raised message is formatted to make it easy to parse. 3) The next version of SQL Server will have command for re-raising errors exactly as they were given. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx