dbTalk Databases Forums  

Initializing Global Variable trought output parametr of ExecuteSQL

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Initializing Global Variable trought output parametr of ExecuteSQL in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alex Prints
 
Posts: n/a

Default Initializing Global Variable trought output parametr of ExecuteSQL - 11-09-2005 , 06:40 PM






I use DTS on SQL Server 2000 SP3.

I'm trying to initialize global variable through the output parameter of
Execute SQL Task and I'm having problem.

If I assign a constant value to the local task variable, it can be captured
in global variable through output parameter of Execute SQL Task. For example:

DECLARE @new_run_id INT
set @new_run_id = 12345
select @new_run_id AS RUN_ID_VAR

But if I use stored procedure which returns a value, it doesn't go through
output parameter of Execute SQL Task to my global variable.

DECLARE @new_run_id INT
--set @new_run_id = 12345
EXECUTE SPMN_CREATE_RUN_ID @new_run_id output
select @new_run_id AS RUN_ID_VAR

The procedure itself works, because I can run the same 3 lines of code in
SQL Analyzer and @new_run_id variable is getting the result.

BTW, I check my global variable through the following ActiveX task as:

Function Main()
msgbox DTSGlobalVariables("RUN_ID").value
Main = DTSTaskExecResult_Success
End Function

Does anybody know what could be the issue with using stored procedure
instead of constant value???

Thank you,
Alex.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.