RaiseError with @@ERROR as first parameter

From: ashwini (rajashwini7_at_hotmail.com)
Date: 11/04/04

  • Next message: Martin: "MSDE installation internals"
    Date: 4 Nov 2004 03:46:38 -0800
    
    

    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: Martin: "MSDE installation internals"

    Relevant Pages

    • Re: How to get list of EventClasses in MSSQLServer2000
      ... statement inside a stored procedure has completed.') ... SQL Server statement or stored procedure.') ... Plan','Displays the plan tree of the Transact-SQL statement executed.') ... Login','Occurs when a SQL Server login is added or removed; ...
      (microsoft.public.sqlserver.security)
    • Re: Accessing FoxPro Free Table
      ... which the SQL Server service is running. ... account, ... > If you are creating a stored procedure and you want> to make sure that the procedure definition cannot be> viewed by other users, you can use the WITH ENCRYPTION> clause. ... The procedure definition is then stored in an> unreadable form. ...
      (microsoft.public.data.odbc)
    • Re: Adding date to parameter
      ... SqlClient provider which is specifically written for SQL Server. ... Hitchhiker's Guide to Visual Studio and SQL Server ... and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook) ... I made the assumption that the stored procedure went by the ...
      (microsoft.public.dotnet.framework.adonet)
    • Re: Problem with the Legacy ASP files and the Sql Server Express
      ... table, if another inserting occurs at the nearly exactly the same moment, ... SQL Server will pass it a default value. ... assume that you do have a connection that can reach SQL Server Express. ... unless your stored procedure has some thing that only works ...
      (microsoft.public.dotnet.framework.aspnet)
    • Stored procedure does not complete until result set is retrieved from ODBC
      ... I have a SQL Server Stored procedure that I am executing via ODBC. ... -- Start Code without cursor ...
      (microsoft.public.sqlserver.odbc)

    Loading