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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-02-03 : 08:54:23
|
| Mahesh writes "Hi,I have a stored procedure which executes some SQL statements. I want to retrieve the error ( the value of @ERROR ) using my ASP script. Also i would like to know how can i catch the error thrown by RAISERROR() function in stored procedure using my ASP Script .Thanking YouMahesh" |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2003-02-03 : 18:59:44
|
| You need to capture @@ERROR immediately after each statementINSERT ... whateverSET @Err = @@ERRORYou can pass the error back to ASP usingRETURN(@Err)Look at the articles on retrieving OUTPUT variable for an explanation on retrieving RETURN values.Your errors are also returned in the command object to ASP. The kind of error capture above is usually used to perform conditional execution inside a stored procedure.Sam |
 |
|
|
|
|
|