Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
I want to import from a text file into a table with a Primary Key. One way is to drop the PK, then import data and then ALTER table and add the PK to the table. How it is possible to have the PK in the table and do the import?Canada DBA
derrickleggett
Pointy Haired Yak DBA
4184 Posts
Posted - 2005-05-23 : 01:07:58
Man, you're just posting this on all the forums, aren't you? (by myself)MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA.
CanadaDBA
583 Posts
Posted - 2005-05-23 : 01:18:20
Hey, I like both sql-server-performance and sqlteam forums and I post my questions in both of them and I get differeint ideas.
quote:Originally posted by derrickleggett Man, you're just posting this on all the forums, aren't you? (by myself)MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA.
Canada DBA
amitja
Starting Member
7 Posts
Posted - 2005-06-06 : 08:52:42
Set Identity_insert on before import and then set it back off on the table you are trying to import.Set IDENTITY_INSERT [Tab Name] ONInsert into [Tab Name]....Set IDENTITY_INSERT [Tab Name] OFF