Results 1 to 4 of 4

Thread: import data from txt file

  1. #1
    Join Date
    Nov 2003
    Posts
    1

    Unhappy import data from txt file

    I have no previous experience in MS SQL and i have this little problem : i import data into a table from a txt file (log file after process) and i want to put the time/date string into a column with data type timedate, but i cant make it, there is an error message (cant store char data into timedate field...)
    Any help??
    thanx in advance :P

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    How are you importing it? Using DTS?

    The format of date time in your text file may not be in compatible format with SQL Server datetime format.

    Check BOL for all accepted formats.

  3. #3
    Join Date
    Sep 2002
    Posts
    5,938
    I think you mean datetime column, it has its own format. But you should be able to put the time/date string into character column.

  4. #4
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    create a table with a column which has getdate() as default


    create table x (mytext varchar(7500), date datetime default getdate())

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •