Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trigger problem
Message
 
 
To
26/03/2009 16:20:51
John Deupree
Long Term Care Authority
Tulsa, Oklahoma, United States
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01391619
Message ID:
01391748
Views:
35
>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform