Results 1 to 2 of 2

Thread: import txt into sql

  1. #1
    Join Date
    Mar 2009
    Posts
    1

    import txt into sql

    Hello.

    I am a newbie in sql. I have a txt file like:

    First name, Last Name
    Name1, Lastname1
    Name2, Lastname2
    Name3, Lastname33
    ...

    I would like to import this data into sql server into table with the following columns:

    ID, first name, type, lastname
    where ID should be function newid(); and type is some integer.

    Thank you for your help !!!!

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    You can set default value to newsequentialid() for id column, set type to allow null. Then load data with either bcp or bulk insert, and handle type afterwards.

Posting Permissions

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