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.
| Author |
Topic |
|
gemispence
Yak Posting Veteran
71 Posts |
Posted - 2006-02-18 : 09:05:42
|
| I'm trying to insert a record into a master table, but b/c of the foreign key relationship, I know that I need to first insert a record into the child table so I don't get a foreign key error. The problem is that the record that I'm inserting doesn't have any columns that match up (similar)to the child table, and only a few that match up to the master table. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-02-18 : 09:52:09
|
| Don't quite get you. If you have 2 tables with parent - child (or master - detail) relationship, you should insert into parent table first before inserting into child table----------------------------------'KH'Time is always against us |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2006-02-18 : 10:07:24
|
| gemispence,Seems like you've had several posts lately dealing with PK/FK issues, if exists issues, and general referential integrety issues. Why don't you script out the tables you have questions about (and include PK and FK info), post the scripts, and explain what your objectives are.Be One with the OptimizerTG |
 |
|
|
gemispence
Yak Posting Veteran
71 Posts |
Posted - 2006-02-21 : 12:26:57
|
| Thanks for the Advice TG, but I think I have the PK/FK thing figured out, but I'll definitely keep it in mind for my next related posting.:) |
 |
|
|
|
|
|
|
|