dbTalk Databases Forums  

Default value of global variable

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


Discuss Default value of global variable in the microsoft.public.sqlserver.dts forum.



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

Default Default value of global variable - 06-21-2005 , 03:47 PM






I have a Date type of Global variable, I would like to set system date as
default value of globle variable.

Any help will be appreciated.




Reply With Quote
  #2  
Old   
Ed
 
Posts: n/a

Default RE: Default value of global variable - 06-21-2005 , 06:01 PM






Sally,
The only way I can think of is to create an ActiveX Script and do the
follow:

DTSGlobalVariables("VariablesName") = Date()

Edmund

"Sally" wrote:

Quote:
I have a Date type of Global variable, I would like to set system date as
default value of globle variable.

Any help will be appreciated.




Reply With Quote
  #3  
Old   
Sally
 
Posts: n/a

Default RE: Default value of global variable - 06-21-2005 , 06:31 PM



If I want overwrite the default value of DATE global varible from programming,
Is it doable? Or The global variable always keeps the default value if we
use ActiveX script?

"Ed" wrote:

Quote:
Sally,
The only way I can think of is to create an ActiveX Script and do the
follow:

DTSGlobalVariables("VariablesName") = Date()

Edmund

"Sally" wrote:

I have a Date type of Global variable, I would like to set system date as
default value of globle variable.

Any help will be appreciated.




Reply With Quote
  #4  
Old   
Ed
 
Posts: n/a

Default RE: Default value of global variable - 06-21-2005 , 06:35 PM



Global variable always keep the last value that you assign to it, it doen't
matter it is changed by programming or ActiveX Script
Ed

"Sally" wrote:

Quote:
If I want overwrite the default value of DATE global varible from programming,
Is it doable? Or The global variable always keeps the default value if we
use ActiveX script?

"Ed" wrote:

Sally,
The only way I can think of is to create an ActiveX Script and do the
follow:

DTSGlobalVariables("VariablesName") = Date()

Edmund

"Sally" wrote:

I have a Date type of Global variable, I would like to set system date as
default value of globle variable.

Any help will be appreciated.




Reply With Quote
  #5  
Old   
Sally
 
Posts: n/a

Default RE: Default value of global variable - 06-21-2005 , 06:54 PM



Thanks for your reply.
This is my code to execute DTS from programming, after I assign new date to
Date global variable "db" and execute it. However, in the DTS package , there
is ActiveX script to set system date to the "db" again, so it will overwrite
what I assiged from programming.

package.GlobalVariables.Item("db").let_Value(new Date());
package.Execute();

"Ed" wrote:

Quote:
Global variable always keep the last value that you assign to it, it doen't
matter it is changed by programming or ActiveX Script
Ed

"Sally" wrote:

If I want overwrite the default value of DATE global varible from programming,
Is it doable? Or The global variable always keeps the default value if we
use ActiveX script?

"Ed" wrote:

Sally,
The only way I can think of is to create an ActiveX Script and do the
follow:

DTSGlobalVariables("VariablesName") = Date()

Edmund

"Sally" wrote:

I have a Date type of Global variable, I would like to set system date as
default value of globle variable.

Any help will be appreciated.




Reply With Quote
  #6  
Old   
Tom Moreau
 
Posts: n/a

Default Re: Default value of global variable - 06-21-2005 , 08:51 PM



Depending on what you're doing, you could use a Dynamic Properties task and
use a query to assign a value tot he global variable.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
..
"Sally" <Sally (AT) discussions (DOT) microsoft.com> wrote

I have a Date type of Global variable, I would like to set system date as
default value of globle variable.

Any help will be appreciated.




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.