dbTalk Databases Forums  

DTS Global Variable types

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


Discuss DTS Global Variable types in the microsoft.public.sqlserver.dts forum.



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

Default DTS Global Variable types - 04-26-2004 , 05:26 AM






Please, could anyone tell me how to pass NULL to the global variable of data type Date
I need to start my DTS package from EM, but when i enter NULL into the window with global variable i receive error message "Could not convert variable startDate from type BSTR to type Date.
What should i put there? Empty string does not work either
Please help!

mnd


Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: DTS Global Variable types - 04-26-2004 , 08:11 AM






There isn't a decent way of doing this. Null is really a DB type option. The
DTS variables, as variants can accept Nothing or Null, but then these are
treated a Empty and Null types when viewing the properties dialog. Nether
can be manually set. Chances are that if you use this then when reading them
they will produce and error due to the unexpected nature.

For example if I use my variable in a SQL query -
SELECT * FROM sysobjects WHERE crdate = ?

A date value works fine, set like this -
DTSGlobalVariables("aa").Value = CDate("2003-01-01")

If I change the value to Null
DTSGlobalVariables("aa").Value = Null
....then the SQL task errors.


--
Darren Green
http://www.sqldts.com

"mndr" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Please, could anyone tell me how to pass NULL to the global variable of
data type Date?
I need to start my DTS package from EM, but when i enter NULL into the
window with global variable i receive error message "Could not convert
variable startDate from type BSTR to type Date."
Quote:
What should i put there? Empty string does not work either,
Please help!!

mndr




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

Default Re: DTS Global Variable types - 04-26-2004 , 08:36 AM



thank you for reply
i was suspecting that, but i was hoping i was wrong :
MNdreu

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.