Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instead of Update trigger
Message
De
08/08/2011 18:35:46
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
01520382
Message ID:
01520462
Vues:
36
J'aime (1)
Dmitry,

It seems to me that you are doing an awful lot of work just to keep from using nulls. Use RI in your database then in your CAs check the columns that need to be null and and set the empty values to null before you save the row. JMHO.


>Let me give you an example. User creates a purchase order. One of the fields of the purchase order is a cost center (an account) to which P.O. could be optionally charged. Each cost center is a unique field in the Cost Center table. The P.O. table has Cost Center foreign key. This Cost Center is a char field. If user enters a Cost Center in the P.O., everything is well. But when user clears (removes) entry from the P.O. table (because he/she decide that they do not want to charge the P.O. to a cost center), I want the Cost Center in the P.O. table to be empty string (not NULL).
>Also when user deletes a Cost Center from the Cost Center table, after a warning, the foreign key in all P.O.s where the deleted Cost Center was used should be either set to NULL or empty string. I need/prefer that it is set to empty string. This is why I needed to have record in the Cost Center table with empty value in the Cost Center field.
>
>Does it all make sense?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform