I am loading data from DB2 to SQL Server, I defined the SQL Server column as Date type as DATE, but then i move data DB2 Date field to Sql Server Date fields it is aborting. I tried SQL Server column defining TimeStamp it worked with Current TimeStamp.
So, my question is what is best SQL server data type I need to use and How to convert DB2 Date to Timestamp so that i can use it to insert in SQL Server. ( I am new to sql server)
Any Help is appreciated!
Thanks
DB2 Date to SQL Server Date or TimeStamp
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Thanks Ray,
I am not sure will it store as timestamp or Char filed if i concatenate "00:00:00.000" and move the filed to SqlServer. If it stored as Char - i hope we may not able to do data functions on this field.
But I did defined the SqlServer column data type as Chat and selected Data element as "SQL.SMALLDATETIME". By doing this i could able to insert the Date from DB2 by doing Oconv on Input data column.
Hope i am doing right, need to do some Data calculation on SqlServer Date filed.
Let me know if i did wrong by following the above.
Thanks.
I am not sure will it store as timestamp or Char filed if i concatenate "00:00:00.000" and move the filed to SqlServer. If it stored as Char - i hope we may not able to do data functions on this field.
But I did defined the SqlServer column data type as Chat and selected Data element as "SQL.SMALLDATETIME". By doing this i could able to insert the Date from DB2 by doing Oconv on Input data column.
Hope i am doing right, need to do some Data calculation on SqlServer Date filed.
Let me know if i did wrong by following the above.
Thanks.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There are no SQL data types within server jobs. This means that, even though you perform a "string" operation, if the metadata specify that the column is TimeStamp, it will be stored as TimeStamp.
:D
:D
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
First, make sure the DB2 date is in a format of mm/dd/ccyy. Then in the transformer right before the load to SQL sever, use the following datatype in "data element" column:
SQL.SMALLDATETIME. The length is 16 and display size is 19.
using this datatype in the target column, will make ensure u convert DB2 date to SQL server date time.
SQL.SMALLDATETIME. The length is 16 and display size is 19.
using this datatype in the target column, will make ensure u convert DB2 date to SQL server date time.