>I have tested bcp to replicate the image of a table. Basically, this serves for bulk insert. So, once I have everything exported to a .dat file, I can then import it into another SQL Server database on an image of that table. That works. If I try it on the same database, having 61 records, I will end up with 61 additional records once I import it. But, this is not what I want. I need to have a clean way to replicate a table from one database to another. I need to preserve the primary keys as is. Is bcp able to do that?
Michel,
Would the -E switch help ?
-E
Specifies that identity value or values in the imported data file are to be used for the identity column.
If -E is not given, the identity values for this column in the data file being imported are ignored,
and SQL Server automatically assigns unique values based on the seed and increment values specified during table creation.
http://msdn.microsoft.com/en-us/library/ms162802(SQL.90).aspxhttp://msdn.microsoft.com/en-us/library/ms186335(SQL.90).aspx
Gregory