DTS global variable value not being set properly

  • Hi All...

    I have the following sql statements in a DTS Execute SQL task object and the package has a global variable, gvbeginningcdrid, which the Execute SQL task sets. The stored procedure works fine and has been tested both from within the package and from within QA. So I am certain the problem lies within DTS itself. On the global variables tab of the Parameters tab in the Execute SQL task, I have selected row value and have set the output parameter to the aforementioned global package variable. The task tests okay when I click on the parse query button and it executes without problem. However when I open the packagae properties and check the value of gvbeginningcdrid, it is incorrect. Any suggestions of where to look for the cause of this issue and how to resolve it?

    thanks!

    Michael

    DECLARE @rc int

    DECLARE @partition varchar(10)

    DECLARE @nextid int

    DECLARE @id int

    -- Set parameter values

    EXEC @rc = [TrafficAnalysis_Prod].[dbo].[usp_get_next_tblcdr_id]

    @partition = 'aged', @nextid =@id OUTPUT

    SELECT @id AS next_cdr_id

    Michael Weiss


    Michael Weiss

  • How do you run the package (task) and when do you test the content of the glVariable?

    Are you doing it all within DTS designer?

    -Tom.

  • Hi Tom,

    Yes...I am testing it from withing DTS Designer...

    Michael

    Michael Weiss


    Michael Weiss

  • Hi Michael,

    Just to be sure - are you opening the package and then execute your task and then checking value of the global variable - all in one session?

    or

    you run the package and then open it to inspect the global variable value?

    Tom

  • I am opening the package and executing the task and then checking the value of the global variables in the package properties, Tom. Have done this a lot in the past and never had a problem with the variables not reflecting the correct values.

    Thank you,

    Michael

    Michael Weiss


    Michael Weiss

  • try this...DTS gets funny with return codes and setting output variables.

    DECLARE @rc int

    DECLARE @partition varchar(10)

    DECLARE @nextid int

    DECLARE @id int

    set nocount on

    -- Set parameter values

    EXEC @rc = [TrafficAnalysis_Prod].[dbo].[usp_get_next_tblcdr_id]

    @partition = 'aged', @nextid =@id OUTPUT

    set nocount off

    SELECT @id AS next_cdr_id

    Signature is NULL

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply