ddl_table_events.
The question is: can I know inside the trigger logic
(after "as" keyword) 
which event type of this event group has fired the 
trigger?
my code:
use AdventureWorks
go
create trigger 
TableEvents
on database
for ddl_table_events
as
select * from 
sys.trigger_events
go
I found nothing in sys.trigger_events has
changed inside the trigger.
So finally, I want to know which of "create
table" , "alter table" or "drop 
table" has fired the trigger?
Please take a look at the EVENTDATA function. This returns the event that was fired, the command that raised the event and so on. See below topic for more details:
http://msdn2.microsoft.com/en-us/library/ms173781.aspx
 
No comments:
Post a Comment