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 |
oceanboy
Starting Member
44 Posts |
Posted - 2007-02-26 : 22:34:07
|
Hi all,I have a question which I failed to find much information on the internet. It's about the trigger.Scenario:A trigger has been written for a table where when we insert some values, the trigger will pull in information from other tables that are relevant to the values we inserted. Now I thought I would need to do some checking where if the information from other tables are not available, the insert will not happen or only the set of records where the relevant information from other tables are available will be added. Question#65306;1#65289;this trigger is written in FOR inserted. Can I do the checking in the trigger and use DELETE to get rid of those records which have no relevant information from the calling insert statement2) or is it better to use INSTEAD OF TriggerThanks!OB |
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2007-02-27 : 09:38:51
|
How is this data being inserted? What sort of values are you inserting from other tables, and on what basis? If you want to avoid inserting rows based on the values being inserted, then an INSTEAD OF Trigger would do it. However, it sounds like there is probably more to this.Mark |
 |
|
|
|
|