Re: Bulk Insert With Identity Field

From: Prabhat (not_a_mail_at_hotmail.com)
Date: 09/20/04


Date: Mon, 20 Sep 2004 17:11:13 +0530

Thanks for that Link.
Prabhat

"Nigel Rivett" <sqlnr@hotmail.com> wrote in message
news:1e3601c49ef2$d46130b0$a501280a@phx.gbl...
> 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
> >
> >
> >.
> >



Relevant Pages

  • Re: Importing text files - DTS help needed
    ... Both can read a standard BCP format file. ... I'm using SQL 2000 and DTS and trying to import a huge fixed width text file. ... I don't want to use bcp if possible - but surely there's a way to get DTS to read from a format file so I don't have to click 200 times (with all the ensuing errors I could make). ...
    (comp.databases.ms-sqlserver)
  • Re: C2 Audit and BCP
    ... I'd like to be able to identify that an "insert bulk" statement has ... All of the SQL Statements that are run are identified solely by the ... events but nothing legible in the text data column. ... This isn't an issue with the functionality of BCP, ...
    (microsoft.public.sqlserver.security)
  • Re: More efficient way to insert a dataset in .NET 2.0?
    ... If you have a large set of data you need to import into a SQL Server database, you should use the SQL Server BULK INSERT command. ... I changed the way it inserted, so that it used the bulk insert transact sql statement, using a format file to define the format of the data. ... From the time it started inserting to the time it finished was 15 seconds...the entire app runs in under 2 minutes now. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Bulkinsert Problem
    ... An alternative approach may me to use the SQL Server Bulk Copy Command ... For more details refer to the "bcp Utility" article in SQL ...
    (microsoft.public.sqlserver.programming)
  • RE: Bulk Copy / BCP problem....please advise
    ... >slower than using bcp or bulk insert but it could help. ... >> regular basis into my SQL Server using either Bulk ...
    (microsoft.public.sqlserver.programming)