tags:

views:

135

answers:

1

This one has bugged me for the longest time and a great question to ask the Stackoverflow users I think.

I have a rather large SSIS flow that uses a string variable to store the datetime. I would now like to dynamically read the datetime value from the database, but how would you construct the SSIS to do this?

My first obvious thought would be to simply execute a SQL task to get the datetime and store it in the variable, but got the "differs from the current variable type" error.

Is there a simple way to convert the database datetime into a String variable?

Any help from the community would be appreciated,

+2  A: 

Sure you use a derived column and convert the data from the datbase column to one of the correct type.

Another method would be to use t-sql code as your data source and do the cast inthe t-sql code so that the field comes into the dataflow as string.

Or of course you could change the string to a date type.

HLGEM
Great stuff HLGEM, since I was already using t-sql code so I altered my SQL to do a CONVERT.Really appreciate the suggestions and they are all good.
Mark Kadlec

related questions