Re: Output Parameter To Global Variable (DTS)

From: Darren Green (darren.green_at_reply-to-newsgroup-sqldts.com)
Date: 10/16/04

  • Next message: Karthik R: "Re: Approaches!"
    Date: Sat, 16 Oct 2004 18:56:42 +0100
    
    

    In message <9A2E6860-3F67-4FA3-A74D-4F7B1FEC0089@microsoft.com>, Paul
    Timmerman <PaulTimmerman@discussions.microsoft.com> writes
    >I thought I had the parameters mapped properly. I have read the mentioned
    >article and used the dummy code.
    >
    >When I run
    >
    >DECLARE @OutputTest1 int, @OutputTest2 int
    >EXEC dbo.spInputAndOutputTest ?, ?, @OutputTest1 OUTPUT, @OutputTest2 OUTPUT
    >SELECT @OutputTest1 AS OutputTest1, @OutputTest2 AS OutputTest2
    >
    >in QA, the ouput variables return as NULL. I think that is normal.
    >

    If you run this in QA I would expect an error because you still have the
    ? place holders in there. If you supply real values instead then you
    should get decent output values as well, as per the simple calculation
    in the procedure.

    >I can get around this whole problem by simply SELECTING the values at the
    >end of the stored procedure thereby having the SP return a result set. This
    >of course nullifies the need for the OUTPUT parameters. I would however like
    >to get them to work. Whatever I do I seem to get NULL valeus for the output
    >parameters.
    >

    Sorry, I am at a loss, as the sample code I posted previously works fine
    for me. Only thing I can think of is that since the output values are
    derived from the input, make sure the input is not null for the sample
    proc, or you could even hard code the output values, although this no
    longer tests that the input is received correctly.

    -- 
    Darren Green (SQL Server MVP)
    DTS - http://www.sqldts.com
    PASS - the definitive, global community for SQL Server professionals
    http://www.sqlpass.org
    

  • Next message: Karthik R: "Re: Approaches!"

    Relevant Pages

    • Sample code for Connecting and Executing a stored procedure is SQL server using ASP.NET
      ... Can you one give me some sample code for connecting to the SQL server DB and ... executing a stored procedure in the SQL server using ASP.NET? ...
      (microsoft.public.dotnet.framework.aspnet)
    • 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)