REA_ANDREW
asked on
BULK INSERT
HI,
I have having a little trouble with this T-SQL procedure.
I need it to auto generate the ID field when I execute the command against my file. But it keeps coming back with an error about Not for Replication.
Has anyone had experience of this when you have an Identity Column?
Thanks in advance
Andrew
I have having a little trouble with this T-SQL procedure.
I need it to auto generate the ID field when I execute the command against my file. But it keeps coming back with an error about Not for Replication.
Has anyone had experience of this when you have an Identity Column?
Thanks in advance
Andrew
ASKER
I am using this
BULK INSERT theusedcarsearch.dbo.tbl_C ars
FROM 'D:\home\Default\theusedca rsearch.co m\htdocs\F eeds\UsedC arSql.sql'
WITH
(
FIELDTERMINATOR ='¦',
ROWTERMINATOR = '\r\n',
KEEPIDENTITY
)
completes 60,000 rows in 30 seconds, so for speed it is for me BUT, it complains about the ID column when I have the parameter KEEPIDENTITY
inline with
http://msdn2.microsoft.com/en-us/library/ms188365.aspx
BULK INSERT theusedcarsearch.dbo.tbl_C
FROM 'D:\home\Default\theusedca
WITH
(
FIELDTERMINATOR ='¦',
ROWTERMINATOR = '\r\n',
KEEPIDENTITY
)
completes 60,000 rows in 30 seconds, so for speed it is for me BUT, it complains about the ID column when I have the parameter KEEPIDENTITY
inline with
http://msdn2.microsoft.com/en-us/library/ms188365.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
which one?
anyhow:
when loading (external) files to sql tables, I can only recommend 1 thing:
use staging tables to bulk load the data to, validate there, and the copy to the final table.
see also here:
http://www.sqlteam.com/item.asp?ItemID=3207