General information
Forum:
Microsoft SQL Server
Title:
Triggers, stored procedures
I want to recreate a VFP database in SQL Server 7.0
In FoxPro, you can define a relationship between two tables and have FoxPro automatically generate stored procedures for insert, update, and delete.
For Updating the parent key field, there are Cascade, Restrict, Ignore options.
For Deleting the parent record, there are Cascade, Restrict, Ignore options.
For Inserting a Child record, there are Restrict, Ignore options.
Deleting a parent is not problem, I can make a trigger to delete all related children when a parent is deleted (cascade)(this gives strange result codes back to VFP, though). I can make a trigger to disallow deletion of a parent when there are children present (restrict).
Inserting a child is not a problem, I can disallow a new child with no parent, but I don't know how to cascade parent key changes to children when it is more than 1 parent record being changed.
This is not a situation that happens often, but we are keeping the VFP database for offline use and it might become important if something terrible happens and we have to fix things.
Any help would be appreciated.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only