dbTalk Databases Forums  

Creating a global variable at run-time

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


Discuss Creating a global variable at run-time in the microsoft.public.sqlserver.dts forum.



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

Default Creating a global variable at run-time - 04-10-2006 , 02:59 PM






Hello, I am loooking for code that will demonstrate how to create/remove a
global variable(s) at run time through an ActiveX script in my DTS package.

Thanks!

Ric

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Creating a global variable at run-time - 04-10-2006 , 08:16 PM






Hello Ric,

You could use something like this

Function Main()

dim gv

set gv = DTSGlobalVariables.Parent.GlobalVariables.New("A")

gv.Value = "Hello"

DTSGlobalVariables.Parent.GlobalVariables.Add gv

MsgBox DTSGlobalVariables("A").Value

Main = DTSTaskExecResult_Success
End Function


Unless you save the package after doing this then the GV is only valid for
the running of the package



Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
Hello, I am loooking for code that will demonstrate how to
create/remove a global variable(s) at run time through an ActiveX
script in my DTS package.

Thanks!

Ric




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.