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
 Transact-SQL (2000)
 Trigger error: label?

Author  Topic 

souLTower
Starting Member

39 Posts

Posted - 2009-03-10 : 14:37:32
Hello all. I'm looking at a database trigger and I see the following at the end of the trigger:


error:
raiserror @errno @errmsg
rollback transaction


I recognize the "error:" as a label but it's not referenced elsewhere in the trigger. Is this a system label that I could use in any TSQL procedure or function?

Thanks

God Bless

guptam
Posting Yak Master

161 Posts

Posted - 2009-03-11 : 02:37:28
It was most likely used as error handling with GOTO statement...

ref: http://msdn.microsoft.com/en-us/library/ms180188.aspx

If you are not using it with your go-to statement you might want to look at fixing this if these code execute all actions in the trigger are rolled backed. Thanks.

--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCITP: Database Administrator
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
Go to Top of Page
   

- Advertisement -