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 2005 Forums
 Transact-SQL (2005)
 trigger to execute script

Author  Topic 

coleman8er
Starting Member

7 Posts

Posted - 2008-04-01 : 13:56:16
I have never dealt with triggers before, I was wondering if it is possible to create a trigger that executes a script which transfers data from table1 to table2, upon table1 recieving new records.

I have the script written to transfer the data, I just dont really know the syntax of trigger creation. Any input would be great, thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-04-01 : 13:58:50
Yes it's possible. Check out CREATE TRIGGER in SQL Server Books Online. Make sure you use the inserted trigger table rather than Tsble1 for your query though.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -