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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Trigger On insert

Author  Topic 

venkateshnaik
Starting Member

2 Posts

Posted - 2009-10-05 : 02:33:24
Hi all,


I need to write a trigger on insert to copy iserted record to another table

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-10-05 : 02:42:57
Put this into your after insert trigger

insert into new_table ( col1,col2,col3,... )
select col1,col2,col3,... from Inserted

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

Kabila
Starting Member

33 Posts

Posted - 2009-10-05 : 02:45:09
Create Trigger Trigger_name
For insert as
Begin
Insert into Tablename Select * from inserted
End

Tablename--Another table name
Go to Top of Page
   

- Advertisement -