Bulk Insert With Identity Field
From: Nigel Rivett (sqlnr_at_hotmail.com)
Date: 09/20/04
- Next message: g: "destring a string -"
- Previous message: g: "How to split a name field and write to Lname + Fname"
- In reply to: Prabhat: "Bulk Insert With Identity Field"
- Next in thread: Prabhat: "Re: Bulk Insert With Identity Field"
- Reply: Prabhat: "Re: Bulk Insert With Identity Field"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 20 Sep 2004 02:18:45 -0700
You can use a format file
see
http://www.nigelrivett.net/BCP_quoted_CSV_Format_file.html
But it's easier just to create a view which excludes those
columns and bcp into that.
>-----Original Message-----
>Hi All,
>
>Can I Bulk Insert to to SQL Table with a Identity Column
in it?
>
>My Source is a text file with 17 Columns and My Target is
a SQL Server table
>with 18 Columns (all 17 column of the source + 1 Identity
Column as Primary
>KEY).
>
>So In this Situation How can i Bulk Insert to the SQL
Table from the text
>file. Please give small example if possible.
>
>Also If my SQL table is have 2 More Extra Column Can I
Boul Insert from the
>above source?
>Ex: Total 19 Columns ( all 17 columns of the source text
file + 1 Identity
>Column + 1 Extra column). If I want to Insert into the 17
columns and I want
>the Indetity column to generate auto numbers and the Last
Extra Column to be
>Filled with Some "Char (1)" Value. Is that Possible?
>
>Thanks for any Help or suggestions
>Prabhat
>
>
>.
>
- Next message: g: "destring a string -"
- Previous message: g: "How to split a name field and write to Lname + Fname"
- In reply to: Prabhat: "Bulk Insert With Identity Field"
- Next in thread: Prabhat: "Re: Bulk Insert With Identity Field"
- Reply: Prabhat: "Re: Bulk Insert With Identity Field"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|