Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Cascade FK values from VFP?
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01537208
Message ID:
01537221
Views:
24
>>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

I think I found where I was mistaken.

UPDATE: Nope. I added SQLEXEC( nHandle, "BEGIN TRANSACTION") but it does nothing. :(
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform