SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Dates and Times via SSIS


Dates and Times via SSIS

Author
Message
TSQL Tryer
TSQL Tryer
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1789 Visits: 715
I do apolagise for all these questions.

I have a staging database. This database has a table - "table1". I have a few columns but two that I want to transfer.
ID = int
planned_start_date = datetime.

Sample of the data is -
id - 1875
planned_start_date - 2012-06-13 12:00:00.000

What I want to do is transfer it to the datawarehouse database as the following -
"table2"
id - 1875
planned_date -2012-06-13
planned_time - 12:00:00.000

So keep the date and time seperate?

Any ideas please are welcome.

Thanks
TSQL Tryer
TSQL Tryer
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1789 Visits: 715
I think I have worked it out.

Created a table in my datawarehouse called 'table2', with columns -
id - int
date - datetime
time - time(7)

The in my SSIS Data Flow Task I have a "Data Conversion" task inbetween my source and destination.

I've then added the input colum of "planned_start_date" twice, one with an output alias of "date" and one of "time" with the datatype of database date and database timestamp respectively and it appears to do what I want it to.

Thanks
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: General Forum Members
Points: 62288 Visits: 13298
The only change I still would made is change the data type of the first column from datetime to date.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search