Raising errors from SQL Server

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!
 
M

Mark Rae

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top