How to get SQL Server Error messages

  • I am trying to develop a SQL Server Stored Procedure, which will be called from shell scripts, so I can not really trap the error messages on the Front End. Inside Stored Procedure, I get @@Error, but that is just a error number. The SysMessages table has general info about this table, but would not give me the column name etc.

    Does anyone know how to get exact error message in Stored Procedure?

  • You can get the Error message from master.dbo.sysmessages. You need to capture the Error code with help @@Error and use the following one

    Select substring(Description, 1,150) form master.dbo.sysmessages where Error = @Err

    Shas3

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply