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
 General SQL Server Forums
 New to SQL Server Programming
 Help with a Migrating script

Author  Topic 

xrum
Yak Posting Veteran

87 Posts

Posted - 2011-01-03 : 14:28:07
Hi,

i need to migrate some data from access to sql.

access has one table.

make model

i am making two tables in SQL

tblMake
id make

and

tblModel
id makeID model



i've moved the makes over, but now i can't figure out how to migrate the models to match up with the makeIDs, since i am recreating ID's, how do i match them up?

please help



dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2011-01-03 : 14:38:44
Better off keeping the data in one table. ID/Make/Model. having worked with auto industry related data in the past...you will be better off that way.

However, if you need two tables:

Create a Make table (ID,Make)

Create a Model table (ID,MakeID,Model)

insert records from source to Make table generating the Make ids.

Insert records from Source table LINKED TO Make table on make column, and pull the Make ID there

Select tblMake.ID , tblSource.Model
FROM tblMake inner join tblSource on tblMake.Make = tblSource.Make




Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page

xrum
Yak Posting Veteran

87 Posts

Posted - 2011-01-03 : 14:48:06
thank you!
Go to Top of Page
   

- Advertisement -