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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RAISERROR not working as expected

Status
Not open for further replies.

pandatime

Programmer
Joined
Jan 29, 2010
Messages
92
Location
AU
Hi,

I have this line of code in my proc:

RAISERROR ('Found leftover files, 20, 1)

but when the code reaches this point of execution, it just keeps on chugging along... No, I want the code to STOP running at this point and return the error, whether from a SQL window or from a job. I tried severity 16, that didn't work, but neither does 20.

Help

thanks
 
ok nevermind, i guess in need to add a "return" as well
 
If SQL Server 2005 or higher, you could use Try-Catch for greater flexibility.

[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top