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)
 How To write before Trigger in sql server...

Author  Topic 

mpolaiah
Starting Member

24 Posts

Posted - 2009-09-22 : 08:48:31
Hi All,


i am using sql server 2005

i am mainiting the History of my table
so
before update record how to insert the record in history table
two table have same columns

using trigger

please help meeeeeeeeeeeeeeeeeee..........


yours
pole.

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-09-22 : 09:16:23
Why you use Before Trigger?

Use After trigger and insert the data to your history table from deleted(old value) table.

Try like this

insert into histoy_table (c1,c2,c3,c4)
select c1,c2,c3,c4 from deleted

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

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

- Advertisement -