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 |
srikanthkamuju
Starting Member
1 Post |
Posted - 2010-01-08 : 06:32:16
|
Hi all,I am new to sql servermy requirement is i have 2 table below the tables structure1 emp 2 copy Empid ename salary id ename salary statuswhen ever a record is insereted into the emp table the same record should insert automatically into copy emp recordhow to achieve this using triggerstell me step by step because i am weak in sqlthanks in advancesrikanth |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-01-08 : 10:52:44
|
[code]CREATE TRIGGER CopyEmpInsertON EmpAFTER INSERTASBEGININSERT INTO CopyEmpSELECT id,ename,salary,<your status value>FROM INSERTEDEND[/code] |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2010-01-08 : 11:10:26
|
quote: Originally posted by srikanthkamuju Hi all,I am new to sql servermy requirement is i have 2 table below the tables structure1 emp 2 copy Empid ename salary id ename salary statuswhen ever a record is insereted into the emp table the same record should insert automatically into copy emp recordhow to achieve this using triggerstell me step by step because i am weak in sqlthanks in advancesrikanth
Read about Triggers in BOL. This is the very basic of triggers and you are better off if you read it and implement it yourself.EDIT : This should be a start.http://msdn.microsoft.com/en-us/library/ms189799.aspx |
|
|
debrah.h48
Starting Member
4 Posts |
Posted - 2010-01-17 : 23:38:55
|
Hope this discussion forum will give you clear picture on this topic.(spam removed) |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-01-18 : 00:43:33
|
quote: Originally posted by debrah.h48 Hope this discussion forum will give you clear picture on this topic.<SPAM LINK REMOVED>
There is nothing in your link that is relevant to the OP |
|
|
|
|
|