Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kurtgr
Starting Member
25 Posts |
Posted - 2009-07-10 : 21:15:20
|
| Hello ExpertsBelow is my Delete TriggerALTER TRIGGER [dbo].[DeleteSkill] ON [dbo].[Skill] FOR DELETEASBEGIN IF EXISTS(SELECT 1 FROM EmployeeSkill INNER JOIN Deleted ON EmployeeSkill.SkillId = Deleted.SkillId) BEGIN RAISERROR('Record already been used in related table(s). Delete failed!', 16,1) ROLLBACK TRANSACTION RETURN END ENDHere is my problem when the condition hold true for the first time if get the message from the RAISERROR.But say I click the delete button again without changing anything the trigger does not fire.I am doing the delete from the table true a store procedureCan you say if my trigger is missing somethingThank in advance |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-12 : 04:20:05
|
| why are you doing this via trigger? its just a matter of setting foreign key reference from EmployeeSkill.SkillId to Skii.SkillId |
 |
|
|
|
|
|