SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 @@error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

keithc1
Yak Posting Veteran

88 Posts

Posted - 06/28/2004 :  23:05:30  Show Profile  Reply with Quote
When is this global variable populated, is it specific to delete/insert/update statements?

I guess what i'm trying to figure out is how do I know when to use Raiserror instead of @@error?

Keithc MCSE MCSA

derrickleggett
Pointy Haired Yak DBA

USA
4184 Posts

Posted - 06/28/2004 :  23:34:43  Show Profile  Visit derrickleggett's Homepage  Send derrickleggett an AOL message  Send derrickleggett a Yahoo! Message  Reply with Quote
You use RAISERROR anytime @@error <> 0.

IF @@ERROR <> 0
BEGIN
RAISERROR('AHHHHHHHHHHHHHHHH, ITS TERRIBLE!!!!',16,1)
RETURN -1
END

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.33 seconds. Powered By: Snitz Forums 2000