Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Cascade FK values from VFP?
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01537208
Message ID:
01537216
Vues:
29
>Hi,
>
>I am creating a procedure in the VFP 9 application that will Cascade update of all FK values in child tables when user changes the value of unique field in the parent table. What I do is set "transactions" to 2 (via SQLSETPROP) and then update Parent table and then Child Tables. But I get error that the update conflicts with the Foreign Key constraint set in the SQL Server on a Child table. I thought that the "transaction" will take care of it. So is there a way to get around this? Is there a way to make SQL Server ignore the constraints until the Transaction is finished? Any other suggestions? TIA.

I suggest to use SQL Server transactions, e.g.

BEGIN TRANSACTION
UPDATE Parent
UPDATE Child
COMMIT TRANSACTION
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform