Re: Bulk Insert With Identity Field

From: Wayne Snyder (wayne.nospam.snyder_at_mariner-usa.com)
Date: 09/20/04


Date: Mon, 20 Sep 2004 07:57:12 -0400

using bulk insert there is a keepidentity parameter, using bcp it is -E...
Both are documented in books on line

-- 
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Prabhat" <not_a_mail@hotmail.com> wrote in message
news:OKa8j8unEHA.3868@TK2MSFTNGP11.phx.gbl...
> 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: Generating one table with a terabyte of data
    ... Pretty much disabled the transaction log completely. ... We are using BULK INSERT ... for all those who don't know, SQL server prefers smaller BULK ... ORACLE seems to handle that 1 big file really well but with small files SQL ...
    (microsoft.public.sqlserver.dts)
  • Re: Recordset.AddNew and the recordset objects data retaining
    ... I am in an environment where bulk insert isn't an option--even though the ... underlying database is SQL server, I am using a third party OLE DB provider-- ... > insert(assuming you are using SQL server) or DTS. ...
    (microsoft.public.data.ado)
  • Re: Can Indexes effect Bulk Insert/Update Operations
    ... Columnist, SQL Server Professional ... becuase some operations need to be performed before insert/update the ... "Tom Moreau" wrote in message ... > unique/pk constraints before bulk loading the tables. ...
    (microsoft.public.sqlserver.programming)
  • Re: Timeout Expired
    ... So the timeout occurs during the bulk load operations? ... did you check the SQL Error Logs to see more clues about the timeout problem if there is any? ... locked for DML operations by SQL Server. ...
    (microsoft.public.sqlserver.server)
  • Re: Generating one table with a terabyte of data
    ... Run perfmon counters to a log and analyze them after a bulk load. ... > On fast bulk loads you should make sure that the database is not logging. ... >> I've locked SQL server to 1/3 physical memory usage. ...
    (microsoft.public.sqlserver.dts)