Re: RaiseError with @@ERROR as first parameter
From: Adam Machanic (amachanic_at_hotmail._removetoemail_.com)
Date: 11/04/04
- Next message: Alejandro Mesa: "RE: User Defined Function Help"
- Previous message: Dennis Burgess: "Re: SQL import dup checking?"
- In reply to: ashwini: "RaiseError with @@ERROR as first parameter"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 4 Nov 2004 09:55:31 -0500
What is that code intended to do? Why would you want to raise an error
without checking to find out if there was an error? Also, even if RAISERROR
would let you do that, if there's no error it won't work -- the MsgId must
be greater than 13000.
-- Adam Machanic SQL Server MVP http://www.sqljunkies.com/weblog/amachanic -- "ashwini" <rajashwini7@hotmail.com> wrote in message news:42e59b86.0411040346.7738477@posting.google.com... > Hi, > > Can anyone help me to use RaiseError with @@ERROR as the first parameter. > Code in my stored procedure is, > > RAISERROR (@@ERROR,15,-1, @err_msg) WITH SETERROR > > On SQL Server 2000 i am getting the compilation error saying > "Incorrect syntax near '@@ERROR'" though this works on Sql server 7. > > I can not change the stored procedure code.. Is there any way of setting up > environment variable or any other method by which I could resolve this problem > without modifying the stored procedure. > > Thanks in advance.
- Next message: Alejandro Mesa: "RE: User Defined Function Help"
- Previous message: Dennis Burgess: "Re: SQL import dup checking?"
- In reply to: ashwini: "RaiseError with @@ERROR as first parameter"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|