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.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Losing primary key on export

Author  Topic 

e.bar
Starting Member

25 Posts

Posted - 2003-04-01 : 20:03:04
When I export a local table to a remote server, the table lost the primary key. What is the code to alter the remote table setting again to it the primary key?

The name of table is dbo.empresas and the column is EmpresaID.
Tks.


tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-04-01 : 20:12:08
You will want to run the ALTER TABLE statement.

BTW, to correct your problem, just generate the scripts through EM and have it include the primary keys and other stuff. Then run this script on the remote server. Then export your data. This is the better way of doing it. But the fastest way of course is to not create the table first.

Tara
Go to Top of Page
   

- Advertisement -