Click here to Skip to main content
15,905,068 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
What is a Triggers in Databases. Please if you could add example, I will be grateful.
Thanks.
Posted
Comments
fjdiewornncalwe 8-Dec-10 10:03am    
My vote of 1: Always try a google search before posting questions here. You will likely get flamed quite badly if you don't do that first.

Hi
You can follow this link.


[^]
 
Share this answer
 
Comments
Bassofa 8-Dec-10 4:58am    
Thanks man; your link has being helpful.
1)if you wanna fire trigger on database creation,use following given code

create trigger T1 on all server
for create_database
as
print 'Database created successfully.'

2)if you wanna fire trigger on table creation,use following given code

create trigger ttt on database
for create_table
as
print 'Table Created Successfully'
 
Share this answer
 
Comments
Sajid Ahmed Shahsroha 19-Mar-11 7:53am    
whoever downvoted me plz could you tell me why ?? so that i can improve myself
[no name] 20-Mar-11 8:38am    
You have only shown database triggers not answered the question from the OP of what a database trigger is

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900