By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,558 Members | 1,603 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,558 IT Pros & Developers. It's quick & easy.

What code is required to use the trigger with the application of .NET & SQL 2005

P: 20
Hi Everyone,

I m using ASP.NET 2005 with C# and SQL SERVER 2005.
I m using stored procedure and sql datasource control to retrieve the data.

I want to use the trigger alongwith storedprocedure.
I have created the following trigger on emp_table.

CREATE TRIGGER Employeee on emp_table

AFTER DELETE AS

DECLARE @empid int
SELECT @empid=empid from emp_table where locationid=(SELECT locationid from deleted)

IF @@ROWCOUNT=0
DELETE FROM location_table where locationid=(SELECT locationid from deleted)
What i wanted to know is how can i use it with asp.net and sql server 2005 when any
update,delete or insert query is executed thru the stored procedure...
Pls let me know the above trigger is right or wrong..


What code is required to use the trigger with the application of .NET

thanxs.....
Apr 22 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.