Asp Stored Procedure Return Error
Contents |
One games Xbox 360 games PC classic asp stored procedure return recordset games Windows games Windows phone games Entertainment All
Asp Stored Procedure Return Value
Entertainment Movies & TV Music Business & Education Business Students & asp oracle stored procedure educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security
Stored Procedure Return Error Message
Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Band Microsoft sql stored procedure return error Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About
Mysql Stored Procedure Return Error
Us Learn more about Stack Overflow the company Business Learn more about hiring
Error Handling In Stored Procedure
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the error handling in stored procedure sql server 2008 Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to get sql error in https://support.microsoft.com/en-us/kb/321903 stored procedure up vote 5 down vote favorite 3 I'm using SQL Server 2005. I created a stored procedure which works most of the time, but I found an instance of where it doesn't do what I want. Currently, the code does something like this if @@error <> 0 begin select @message_error = "There was a database error adding product "+ @product + " to product http://stackoverflow.com/questions/13647437/how-to-get-sql-error-in-stored-procedure line end Where @message_error is an output variable. So, I can select @@error and get a number, but all I really want is the SQL error. Something like Hey, I couldn't do this because there is a fk constraint on this column or whatever. I found this article on msdn http://msdn.microsoft.com/en-us/library/ms178592(v=sql.90).aspx But it only goes over throwing custom exceptions with RAISERROR, I don't want to create my own error message or exception, I just want to know why stuff isn't working. I can execute the stored procedure through Management Studio and see the exact SQL error, but this is tedious trying to match data from the site and manually inserting it that way. How do I get the SQL error text into an output variable? sql sql-server tsql sql-server-2005 stored-procedures share|improve this question edited Nov 30 '12 at 14:53 marc_s 450k918621027 asked Nov 30 '12 at 14:47 Steve G 2,39452347 2 Have you looked at ERROR_MESSAGE msdn.microsoft.com/en-us/library/ms190358.aspx? –Romhein Nov 30 '12 at 14:54 add a comment| 3 Answers 3 active oldest votes up vote 8 down vote accepted Here's part of a stored procedure template I use: /* CREATE PROCEDURE... */ DECLARE @ErrorMessage varchar(2000) ,@ErrorSeverit