Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Instead of Update trigger
Message
From
08/08/2011 15:27:34
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01520382
Message ID:
01520437
Views:
37
>>>>>I am now thinking of doing away with the SQL Server triggers and do the cascading updates and deletes in the VFP application.
>>>>
>>>>(1) Would we be programmers if we were to quit ?
>>>>(2) There must be a way
>>>
>>>(1) Gracias por animarme.
>>>(2) So far the only solution way I found is to implement a Delete trigger so that my child foreign keys would be set to empty string (''). And to use foreign key constraint (in SQL Server) to do Cascading update. This seems to work for 90% of the tables (guesstimate). Except that (as I posted in the past) SQL Server does not allow for setting up some foreign key constraint cascade. For those few cases I will need to find a solution.
>>
>>
>>None of my business, but I've never had a situation - and I cannot think of one - where I had to do that (child foreign keys would be set to empty string )
>>
>>Also, do you have a char field as a key ?
>
>What about Re: Having a row with empty unique field? Thread #1520263 Message #1520278?
>
>Yes, the char field is the unique key field in one table. And this key field has foreign keys in child tables (note that these are not primary keys, just unique key in one table and foreign key in another). When user deletes a record in the unique key table I need to set the foreign keys (in child tables) to empty string (not NULL).


Yes, I remember that message - thought it was about primary keys

Just cannot grasp it

(1) Why would you store a unique key in child tables instead of a primary key ?

(2) >When user deletes a record in the unique key table I need to set the foreign keys (in child tables) to empty string

Sounds a bit strange to me. It is as if when deleting a customer, you change the customer's reference to empty in all the orders of the customer
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform