Raising errors from SQL Server

  • Thread starter Thread starter Phil Townsend
  • Start date Start date
P

Phil Townsend

I need to be able to raise an error from a stored procedure in SQL
Server. I have done this before, but I had access to the master table
and now I do not.

I would like my stored procedure to return an error when more than a
specified number of characters are passed in a parameter. Can anyone
help? Thanks!
 
I need to be able to raise an error from a stored procedure in SQL
Server. I have done this before, but I had access to the master table
and now I do not.

I would like my stored procedure to return an error when more than a
specified number of characters are passed in a parameter. Can anyone
help? Thanks!

This is straight out of BOL...

RAISERROR ('Too many parameters supplied', -- Message text.

10, -- Severity,

1, -- State,

N'abcde'); -- First argument supplies the string.
 
Back
Top