Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple conditions if...else

Status
Not open for further replies.

rosn459

Programmer
Sep 18, 2003
37
0
0
US
Is this logic correct?

IF (@ErrorSaveVariable = 11 or @ErrorSaveVariable = 23 )

BEGIN

PRINT 'Errors encountered, rolling back.'

PRINT 'Last error encountered: ' +

CAST(@ErrorSaveVariable AS VARCHAR(10))

ROLLBACK

END

 
It looks okay, what's the problem?

I would put ROLLBACK TRAN[SACTION] but maybe you can leave the TRAN off.

Did you start with a BEGIN TRANSACTION or is this inside a trigger?

-------------------------------------
A sacrifice is harder when no one knows you've made it.
 
No problem - I'm just checking syntax and logic. I am retrofitting a proc and there was similar logic. I got a funky error and was going through double-checking everything.


Thanks for the second look!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top