January 20, 2010 at 12:40 am
you are defining a delete trigget on a table in which you want to delete the entries of the same table depeneding on the primary key value
its generating the lock error on mysql in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
how u implement that on sql server?
Please suggest me some solution
January 20, 2010 at 2:01 am
Are you referring to nested triggers?
code will help
January 20, 2010 at 2:21 am
I mean, can we use table's primary key as delete trigger id for the same table.
eg. I have table ABC and created a delete trigger. table has primary key... 1,2,3,4, and so on..
now, I have fired the delete trigger with id=2 to delete 2nd row from the same table ABC. can it be possible.
Thanks
January 20, 2010 at 2:37 am
the primary key constraint reqiures values to be unique, by deleting a value, you are still satisfying that reqiurement.
i dont see why you can't
January 20, 2010 at 7:32 am
Perhaps if you read the first article linked in my signature and posted according to those suggestions you might get better, more complete answers.
In SQL Server, by default, a trigger fires AFTER an action so by defining a DELETE trigger you are saying do X AFTER a delete has occurred. So, in your case I have to ask, are you deleting a second row AFTER the initial delete? If so, how are you determining what the second row is?
Here's a link[/url] to an article that presents trigger basics for SQL Server
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply