Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to retain existing primary key values in imported table

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
US
I have to migrate some tables from oracle to sqlserver. I can import the tables and get them into sqlserver but I have not been able to create a primary key column on the tables once they are in sql server. How can I get my data into sqlserver and create a primary key on the table AND populate that primary key column with my existing primary key data? Any attempts to create any primary key on the table once its in sqlserver fail with an error that the table has to be re-created to accomplish it.

Can anybody point me in the right direction to accomplish this? I've got several dozen tables I need to move from oracle into sql server and Im sure there must be a simple way to do it but I just dont know enough about sql server.

thanks




 
I managed to get it done. I had forgotten about the setting in SQL Server Management Studio that prevents making changes that require table re-creation.

But there was also a problem with the imported table data. My existing primary key column came across as a float data type. I changed it to numeric and once those two things were done, I could save all the changes and now Im up and running.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top