Hi
i m working with ASP.Net, C#
i need to have an example of trigger
how to call it from C#, and how to execute???
Hi
i m working with ASP.Net, C#
i need to have an example of trigger
how to call it from C#, and how to execute???
what kind of trigger do you mean?
sql trigger
you dont call a trigger from asp.net, sql trigger is constructed in sql server and it listens for the changes in the specified table(updates, deletes, inserts) .If specified table is modified, then trigger do some changes according to what it is told to.
take this for an example : you have related tables, when the parent table row is deleted you want to delete all the childrows of that parent row, then you specify a trigger for the parent table and tell it to delete all the records in the corresponding child table when a row deleted from the parent table.
Read up on Primary keys and Foreign keys. This is how you relate the tables together with a trigger to delete all childrows or update all childrows when the parent row is modified or deleted. This is all done on the server, so if you wish for an explanation of triggers, please visit the MS SQL portion of this site at: http://www.daniweb.com/forums/forum127.html
Hi
i m working with ASP.Net, C#
i need to have an example of trigger
how to call it from C#, and how to execute???
Hi u4umang2001,
Just check this link, which contains good article. Hope this will help you.
Thanks & Regards
Dilip Kumar Vishwakarma
Programmer
hi i want example for trigger
{CREATE | RECREATE | CREATE OR ALTER} TRIGGER name FOR {TABLE name | VIEW name}
[ACTIVE | INACTIVE]
{BEFORE | AFTER}
{INSERT [OR UPDATE] [OR DELETE] | UPDATE [OR INSERT] [OR DELETE] | DELETE [OR UPDATE] [OR INSERT] }
[POSITION n] AS
BEGIN
.....
END
This is one of the example of firing the trigger
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.