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 |
DiceK-BadMan
Starting Member
12 Posts |
Posted - 2008-05-16 : 05:03:33
|
Hi,I just test the trigger query lately,and there was a problem. For example I have tblprojectsample & tblprojectsample1I used trigger and this is the queryCREATE trigger ProjectInserton tblprojectsample1INSTEAD OF INSERTASBEGIN INSERT tblprojectsample SELECT PROJECTID,DB,URL,STATUS,MAXTARGET,DISABLEFV,MUSTGETEMAIL,SVRNAME,DBNAME,OUTSOURCE,[TIME] FROM insertedENDwhenever I add new row to tblprojectsample1, tblprojectsample also updated but when i tried to check the row or "projectid" in tbleprojectsample1 It results nothing. Can anyone pls explain what happen when I run the query in trigger?I want to update both tables is this possible?but how?thanks |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2008-05-16 : 08:00:14
|
Have you read about triggers in Books Online? You've chosen to use INSTEAD OF INSERT rather than AFTER INSERT.As the event implies INSTEAD OF performs the action of the trigger INSTEAD of performing the insert.Be One with the OptimizerTG |
 |
|
|
|
|