Suppose i am executing a stored proc . Lets there is an exception, how do i write the log in errorlog of MSSQL?
I read about RAISERROR, i got to know that it basically throw exception message to the batch or application? can someone provide me some links to read about it. Suppose if the stored procedure returns int after executing , will it still return the value in case raiserror is called?
asked Mar 20, 2013 at 11:58 AM in Default
You can just specify LOG as part of the RAISERROR command. You can see the details in the Books Online.
For more detail around how to deal with errors in SQL Server, I have an older article that works all around errors and error handling. It was written for SQL Server 2005, but it's still mostly applicable to 2008R2 and 2012.
answered Mar 20, 2013 at 12:06 PM
Grant Fritchey ♦♦