Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Custom Error Message

Author  Topic 

vladimir_grigoro
Yak Posting Veteran

62 Posts

Posted - 2002-08-05 : 06:37:16
If I start a Stored Procedure and there is an error. How could I show a custom message in ASP page not the real one. I want to return a custom message from SQL procedure. Is it possible?

Thanks.

The Rebel

Edited by - vladimir_grigoro on 08/05/2002 06:37:54

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-08-05 : 08:50:21
 
RAISERROR('This is my Custom Error',16,1)

declare @err_txt varchar(200)
set @err_txt = 'This is my Custom Error'

RAISERROR(@err_txt,16,1)



You can also add your own error messages via sp_addmessage

Look at RAISERROR and sp_addmessage in BOL for full sytax and examples


HTH
Jasper Smith
Go to Top of Page
   

- Advertisement -