TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jose Saiz
1.5k
260
102.6k
Trigger for DELETE
Oct 10 2017 9:05 PM
Hi Guys
I am looking for sample Trigger when deleting a row
For Instance (MS-SQL 2008/2012)
I have a shopping cart that has a customer table with Indentity Column on CustomerId datatype integer, Order table etc.
I would like that if any tech support people or my self that query the table customer via the Query Analyzer and by mistake use the statement DELETE or TRUNCATE
that the trigger either Rolls back the transaction or do not accept the deletion.
The reason for the trigger is because I've noticed that I have lots old orders that became orpham because the customer was deleted, and it is too late to implement the foreign key which helps in this case because it does not allow you to delete the customer that is tied to another table with rows.
Thanks
Reply
Answers (
2
)
How do I retrieve a video from MySql Database andplayitin C#
how i insert into database using jquery when drag and drop