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
 SQL Server Development (2000)
 Insert Into Question / Conversion Database

Author  Topic 

da_nootje
Starting Member

2 Posts

Posted - 2010-02-03 : 04:21:48
Hello,

i have a question about conversion from db1 to db2.
I made insert into select query's to insert data into db2 from
db1.
In a few table i put the old PK field, so it's better to make relation between different tables.

I didn't do that for my Domain Tables.

Now they have asked me, why i did that and why it isn't necessary to make extra column in the new Domain tables?

Sorry for my worse English, hopefully someone can help me.

Gr Dennis

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-03 : 04:24:15
sorry you're not clear. are you telling about preserving same value of pk while moving data to db2?
Go to Top of Page

da_nootje
Starting Member

2 Posts

Posted - 2010-02-03 : 04:41:52
Oke sorry,

here explanation of the new situation.
DB1
Table: Project
PK: prj_Code (wwb_001, trend_01 etc etc)
Name: WorldWideBakers, Trendy, etc etc
Contact_Person: 1, 2

Table: Person
PK prs_code (1,2)
Name: Dennis, Mike

DB2
Table: project
PK: project_id (1, 2, 3, 4)
Name: WorldWideBakers, Trendy, etc etc
FK: person_id (8,9)
DB1_prj_Code: wwb_001, trend_01 etc etc


Table: Person
PK: Person_Id (8,9)
Name: Dennis, Mike
DB1_prs_Person: 1,2

DB1_... is the extra column with the PK field from the old database.

It was necessary to insert those extra columns to make a good relation between the different tables.

But why is it necessary en why isn't it necessary to do it with domain tables.

It's a little bit difficult for me to explain it.

Gr Dennis


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-03 : 06:25:56
i really didnt understand what you mean by domain tables.
You need to have a column containing pk values from other db as long as you need to maintain relation between them
Go to Top of Page
   

- Advertisement -