[dba-SQLServer] Global Variables in DTS

chizotz at mchsi.com chizotz at mchsi.com
Thu Sep 9 13:35:45 CDT 2004


I have a complex DTS package that pulls data out an Oracle production 
database, sums and otherwise manipulates it, and stores it in a SQL Server 2K 
database for reporting and further use.

The DTS package is supposed to be run daily, to pull data from the previous 
day's entry into the production database. I have created a global variable in 
DTS, then use an Execute SQL to set the value of the variable to the max date 
already in the data + 1 day. This is not in production yet, but during my 
testing everything (apparently) worked fine for dates prior to 9/6/04. Even 
though the production database definitely has data past 9/6/04, the DTS 
package can not seem to pull it.

I've been tearing some hair out trying to figure this out, until I remembered 
that in order to get DTS to accept a global variable of type Date, I had to 
enter a default value. I went back and checked, and sure enough the value I 
entered was 9/6/04. That can't be coincidence.

I've tried blanking out the value of the global variable, but DTS doesn't like 
that and complains about cannot convert from type BSTR to Date. I've tried 
replacing the value with a date some years in the future, but that also 
doesn't seem to work, and even though it appears to have saved the new value 
after running the package the value has reverted to 9/6/04.

What's the trick to this that I'm missing???

Thanks for any help,

Ron




More information about the dba-SQLServer mailing list