473,385 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
0 1129

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

Similar topics

6
by: Walt | last post by:
It's easy to make a field required for inserts, just set it to not null and don't give it a default. But how does one make a field required for updates? For instance, we have a table with a...
3
by: Wade | last post by:
I would like to install the .Net 1.1 framework on a Web Server running W2K to be able to run ASP.NET files, but I'm not sure where to find the files I need for the .Net framework. I have ".NET...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
2
by: Dima Gofman | last post by:
I have a trigger on UPDATE on a table. I'm running some maintenance UPDATE and DELETE queries which I want the trigger to ignore but at the same time I want other UPDATE queries that other users...
3
by: Karthik | last post by:
I have an application that creates and makes use of a table in tempdb. My problem is that I have a couple of triggers on this table that get dropped everytime SQL Server restarts (due to the fact...
11
by: imani_technology_spam | last post by:
The table in the database has a field called LabID. That field is an integer and consists of the year plus a counter. For example, the first record of 2006 would be "20060001," the second record...
1
by: abhi81 | last post by:
Hello All, I have a table on which I have created a insert,Update and a Delete trigger. All these triggers write a entry to another audit table with the unique key for each table and the timestamp....
0
by: kuruption213 | last post by:
I have an application that inserts a row into a database. This in turn fires a trigger that fires an executable using xp_cmdshell which sends a parameter to a message queue. I then have a message...
7
by: RogBaker | last post by:
I haven't gotten a response yet, so I moved this from another group. I have been working on this for 2 days so if anyone has any ideas, I would be grateful. I have a 3rd party program that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.