June 1, 2010 at 9:22 am
I am trying to insert data from flat file to database table.(sql 2005).
during insert, i am using the following script...
set identity_insert dbo.transactions on
bulk insert workdb.dbo.transactions
from 'd:\transactions.txt'
with (
fieldterminator = '|',
rowterminator = ''
)
set identity_insert dbo.transactions off
while using the above script, i got following error...
Msg 545, Level 16, State 1, Line 2
Explicit value must be specified for identity column in table 'transactions' either when identity_insert is set to ON or when a replication user is inserting into a NOT FOR REPLICATION identity column.
can any one help me on this..
Thanks in advance.
Nithiyanandam.S
June 1, 2010 at 9:39 am
Assuming your import file contains explicit IDENTITY column values, you must add the KEEPIDENTITY option to your BULK INSERT statement for the import process to use them.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
June 2, 2010 at 4:14 am
Hi
Paul White NZ, Thanks lot.
Thanks for your help.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply