Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Great report on PASS Conference!
Message
From
04/10/2005 01:02:16
 
 
To
04/10/2005 00:12:03
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01055576
Message ID:
01055745
Views:
21
Walter,

Further there are problems when you want to insert parent and child records in one transaction. Since you don't know which value SQL server will assign to the PK of the parent, you won't know what value to assign to the FK in the child table. Personally I use a Newkey stored procedure to generate new keys. While identity columns seem an easy choice at first sight, it might catch you later when things start to get a little more complex.

I handle this in a stored procedure - I insert into the parent table, grab the PK that SQL Server assigned by using Scope_Identity, and then use that PK to write out the FKs in the child rows. Haven't run into an issue. What types of problems do you mean?

Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform