Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Great report on PASS Conference!
Message
From
04/10/2005 02:16:07
 
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01055576
Message ID:
01055753
Views:
23
>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

Pardon me,
the only critical issues with identity are:
1. if you have an parentTable "INSTEAD OF" Trigger you are ended ( a bug design ),
because Scope_Identity is unusable.

2. if VFP sends a parametric command ( via sp_executesql) it is not possible to recover the PK identity value, because Scope_Identity is unusable.
Previous
Reply
Map
View

Click here to load this message in the networking platform