February 2, 2012 at 8:43 am
I've built a dtsx package that will import tables from a series of databases. My databases house different views of a table from different periods. The SQL table that I am importing to will have all the columns that the original tables have in addition to a date column which will tell the user what view the record is from. How do I edit my dtsx package so that I can add in a date (to the date column) when I import my saved views?
February 2, 2012 at 8:52 am
Two options that come to mind:
(1) Use the Derived Column transformation in your data flow
(2) When extracting the data from the source tables, use a SQL query as your source, something like this:
SELECT CURRENT_TIMESTAMP AS LoadTime, col1, col2, col3,....
FROM MyTable
John
February 2, 2012 at 9:17 am
Hi John,
What should my expression be when I am using the Derived Column Transformation Editor? I tried "cast(getdate() as date)", but I am getting an error
February 2, 2012 at 9:25 am
I think it's just GETDATE(). In the expression builder, you can drag the functions you want to use from the tree above. No need to cast a function that returns a date to a date data type - and in any case there's no such function as CAST in SSIS expression language. Search for "SSIS expression reference" for further information.
John
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply