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 |
karthikeyan2004k
Starting Member
5 Posts |
Posted - 2014-08-26 : 05:00:10
|
Using Trigger i want to insert a record from a table with condition(person whose age is >31) to another tablePlease let me know the various options for thisThanks in Advancekarthikeyan.r |
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2014-08-26 : 05:13:29
|
I am not sure, but can you try thisCREATE TRIGGER [dbo].[triggername]ON [dbo].[yourtable]FOR INSERT, UPDATE ASBEGIN INSERT INTO yourtable ( col1, col2 ) SELECT value1, value2 FROM Inserted AS Iwhere i.age >31ENDJaveed Ahmed |
|
|
karthikeyan2004k
Starting Member
5 Posts |
Posted - 2014-08-26 : 05:22:15
|
Thanks for Replyingquote: Originally posted by ahmeds08 I am not sure, but can you try thisCREATE TRIGGER [dbo].[triggername]ON [dbo].[yourtable]FOR INSERT, UPDATE ASBEGIN INSERT INTO yourtable ( col1, col2 ) SELECT value1, value2 FROM Inserted AS Iwhere i.age >31ENDJaveed Ahmed
karthikeyan.R |
|
|
|
|
|