Converting the datetime column to text field

  • Hi All,

    I have excel file ,i extract a data from the this excel file and load it into the sql server table(Using ssis),

    there is column called "date" in excel file,this column contains date as well as text say like "res in","res out",this is some text that is been entered in the date column ,

    when i extract the data from the sheet and load it into the table ,my sql server table - date column shows up the "NULL" where ever the text as to be. i have changed th datatype of the date column as nvarchar for the table ,but still i get the same.

    What can i do to get the text in my date column along with the dates.

    plz help me out....

  • Have you included a data conversion task between the source and destination?

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • First import data as varchar or nvarchar into Temp table

    then convert and insert data into real table,

    this should solve your problem.

  • I just remembered something to tell you

    before importing data from excel source into SQL server,change whole excel file as General format.

    This was a real headache for me months before.But this solved many of import problems

  • Hi,

    Its Just an excel File :

    Order No | Date

    F000987 | 23/10/2009

    F000101 |res in

    JkP0091 |10/10/2009

    when i import this 2 column in the sql server table i get like this

    Order No Date

    F000987 23/10/2009

    F000101 NULL

    JkP0091 10/10/2009

    Instead of getting "Res in" i get a NULL values in the table,if it was just a one record i could have simply update the value ,but i have more than 10000 records,and based on some criteria my client make a changes in the excel file ,i just need to import the same values as it is in the excel file.i tried including a data conversion task between source and destination but it doesnt worked out to be right solution.

    As u said ,i even changed the format to "general", but still i get the same,

    Plz do help me

    Thanks & regards

    prabha

  • oK i took a look at this and had the same problem. However i remembered that whilst we were working on a Datawarehouse from my previous job we had teh same issue when bringing in Excel Spreadsheets. try this. On your excel connection manager connection string add the following to the end

    IMEX=1

    please also read this link

    http://support.microsoft.com/kb/194124

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply