Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trigger problem
Message
 
 
À
26/03/2009 16:20:51
John Deupree
Long Term Care Authority
Tulsa, Oklahoma, États-Unis
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01391619
Message ID:
01391748
Vues:
36
>>>I can do it in the UI, but I thought it would be better to keep it in the DB code. I might rethink that, though.
>>>>
>>>>Can you UPDATE cs_enddate field from somewhere else?
>>
>>No I ask because IF you didn't change anywhere cs_enddate but from the DELETE trigger you could use that as a check to see from where that triggers is fired.
>
>No, it's the update trigger normally fires from changes made through the UI. How do you check to see from where the trigger is fired?

If the trigger fired by DELETE action, there is no INSERTED table, only DELETED. For update you have both and for Insert only INSERTED.

So, you can use this to determine which action (UPDATE, INSERT or DELETE) initiated the trigger. For the exact command that triggered it see the link I provided in my original message.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform