all groups > sql server dts > march 2004 >
You're in the

sql server dts

group:

Changing Global Variable valuses from within VBScript



Changing Global Variable valuses from within VBScript <g>
3/29/2004 2:09:44 PM
sql server dts: Is it possible to chage global variable values using VBScript, if so how?


Re: Changing Global Variable valuses from within VBScript Allan Mitchell
3/29/2004 2:21:08 PM
It is possible

Here is an example

Function Main()

dim origVal, newVal

origVal = DTSGlobalVariables("MyVariable").Value

msgbox origVal

'Change

DTSGlobalVariables("MyVariable").Value = "Now I have changed"

newVal = DTSGlobalVariables("MyVariable").Value

msgbox newVal


Main = DTSTaskExecResult_Success
End Function

--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]

Re: Changing Global Variable valuses from within VBScript <g>
3/29/2004 2:51:27 PM
Great thanks.
[quoted text, click to view]

Re: Changing Global Variable valuses from within VBScript Michael Vardinghus
4/4/2004 2:49:42 PM
In the Accelerator an SQL-table is used to store these variables .. is this
because of the number of variables ? When direct coding is possible ?

Perhaps its because of the complexity in the packages where the variables
can be used by several packages ..

[quoted text, click to view]

AddThis Social Bookmark Button