Database table copying

Posted by vbNewbie on Stack Overflow See other posts from Stack Overflow or by vbNewbie
Published on 2010-04-29T20:21:01Z Indexed on 2010/04/29 20:27 UTC
Read the original article Hit count: 291

Filed under:

I am trying to rectify a previous database creation with tables that contains data that needs to be saved. Instead of recreating a completely new database since some of the tables are still reusable, I need to split a table that exists into 2 new tables which I have done. Now I am trying to insert the data into the 2 new tables and because of duplicate data in the old table I am having a hard time doing this.

Old table structure:

ClientProjects   clientId PK
                 clientName 
                 clientProj
                 hashkey    MD5 (clientname and clientProj)

new table structures:

client           clientId PK
                 clientName

projects         queryId   PK
                 clientId  PK
                 projectName 

I hope this makes sense. The problem is that in the old table for example you have clients with multiple clientIds.

© Stack Overflow or respective owner

Related posts about sql-server-2008