![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
I want to import some data into my MS SQL server thought DTS. I have all the filed import ok apart from the date feild as it is in a string format IE 20040408 which relates back to YYYYDDMM. how can i convert this date into a format a format that can be imported into my TimeDate field? Here is the SQL that i have created for the import so far. CREATE TABLE [IPS].[dbo].[RevByyear] ( [YEAR_NBR] varchar (4) NULL, [RES_AGENT_CD] varchar (30) NULL, [INVOICE_AMT] money NULL, [RANK_NBR] int NULL, [PROCESS_DAT] datetime NULL ) I get a message when i import saying TransformCopy 'DirectCopyXForm' conversion error: Convertion invaild for datatypes on coloum pair 5 (sourcecolumn 'Col005'(DBTYPE_STR), destination column 'PROCESS_DAT' (DBTIMESTAMP)). so i am assuming that i can just import the date from my test file straight in without using a convert command somewhere. here are the first 2 line of the TXT file. 2004,MMUSE,205590.64,1,20040409,20040408 2004,MDIKE,162266.26,2,20040409,20040408 So i dont think their can be a problem with the data that i am importing, is their? Willa |
#4
| |||
| |||
|
|
-----Original Message----- I want to import some data into my MS SQL server thought DTS. I have all the filed import ok apart from the date feild as it is in a string format IE 20040408 which relates back to YYYYDDMM. how can i convert this date into a format a format that can be imported into my TimeDate field? Here is the SQL that i have created for the import so far. CREATE TABLE [IPS].[dbo].[RevByyear] ( [YEAR_NBR] varchar (4) NULL, [RES_AGENT_CD] varchar (30) NULL, [INVOICE_AMT] money NULL, [RANK_NBR] int NULL, [PROCESS_DAT] datetime NULL ) I get a message when i import saying TransformCopy 'DirectCopyXForm' conversion error: Convertion invaild for datatypes on coloum pair 5 (sourcecolumn 'Col005'(DBTYPE_STR), destination column 'PROCESS_DAT' (DBTIMESTAMP)). so i am assuming that i can just import the date from my test file straight in without using a convert command somewhere. here are the first 2 line of the TXT file. 2004,MMUSE,205590.64,1,20040409,20040408 2004,MDIKE,162266.26,2,20040409,20040408 So i dont think their can be a problem with the data that i am importing, is their? Willa . |
![]() |
| Thread Tools | |
| Display Modes | |
| |