November 2, 2010 at 10:48 am
We are pulling data from oracle and loading in to SQL server
One column is report_time which is like datetime and need to be formated like YYYYMM when loading in to Sql .
How to convert date in to this format in SSIS..... Do we need to use data coversion or script task?
Please let me know. Thank you
November 2, 2010 at 11:10 am
Data conversion should be faster
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
November 2, 2010 at 11:12 am
Thank you.
But how can I format in Data Conversion to YYYYMM.
November 2, 2010 at 11:56 am
chinni-652949 (11/2/2010)
Thank you.But how can I format in Data Conversion to YYYYMM.
Take the year and month from the date; convert them to strings; pad them to the right length; then concatenate them.
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
November 2, 2010 at 12:34 pm
can we do all that in data convertion task
November 2, 2010 at 12:37 pm
chinni-652949 (11/2/2010)
can we do all that in data convertion task
I believe you should be able to. I do not have time to try it, but it should just be a matter of combining a few instructions in the same expression.
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
November 2, 2010 at 2:12 pm
(DT_STR, 6,1252)((DT_STR,4,1252)YEAR(DATE_COLUMN) +
(DT_STR,4,1252)MONTH(DATE_COLUMN))
I used this expression in derived column task ...... date_column in datebase timestamp (source) and destination column is int.
I am getting error in oledb destination....cannnot convert DT_DBtimestamp to DT_14.
November 2, 2010 at 3:23 pm
Year and month only isn't an acceptable form of a date datatype in SQL Server. You'll have to store a day too (I just default it to the first of the month) and then strip it out at the reporting layer if I need to.
November 2, 2010 at 4:22 pm
its working.
I created new column in derived column and used the above expression with datatye as string.It worked.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply