Wednesday, August 28, 2013

bulk insert into table

Hi ,


Try with KeepIdentity,like below



USE AdventureWorks;
GO
DELETE HumanResources.myDepartment;
GO
BULK INSERT HumanResources.myDepartment
FROM 'C:\myDepartment-n.Dat'
WITH (
KEEPIDENTITY,
FORMATFILE='C:\myDepartment-f-n-x.Xml'
);
GO
SELECT * FROM HumanResources.myDepartment;

Reference - http://technet.microsoft.com/en-us/library/ms186335.aspx



sathya --------- Mark as answered if my post solved your problem and Vote as helpful if my post was useful.


No comments:

Post a Comment