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 |
nqhernandez
Starting Member
1 Post |
Posted - 2008-03-16 : 02:06:57
|
I have a problem..I created a stored procedure. But everytime I test it It seems like it doesnt work..i used @@error for that particular error..This is the last part of my syntax-------------------------DECLARE @err INTSET @err = @@ERRORIF @err <> 0 BEGIN IF @err = 513 RAISERROR('What The Hell Man!!',16,1) ELSE RAISERROR('An unspecified error has occurred.',10,1) RETURN @err ENDELSE RETURN 0GO --------------------------------but everytime I tried to trigger that error 513, the raise error statement does'nt come up... |
|
jonasalbert20
Constraint Violating Yak Guru
300 Posts |
Posted - 2008-03-17 : 06:58:21
|
[code]SET @err = @@ERRORIF @err <> 0 BEGIN IF @err = 513 RAISERROR('What The Hell Man!!',16,1) ELSE RAISERROR('An unspecified error has occurred.',10,1) RETURN @err ENDELSERETURN 0GO[/code]perhaps it does not go to your error checking routine or you forgot to put SET NOCOUNT OFF on your stored procedure so that error will come up.For fast result follow this...http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxWant Philippines to become 1st World COuntry? Go for World War 3... |
 |
|
|
|
|