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 2008 Forums
 Transact-SQL (2008)
 trigger question

Author  Topic 

helpme
Posting Yak Master

141 Posts

Posted - 2010-09-23 : 17:07:41
Whenever a row is inserted, updated or deleted from a table, I need to store a copy of the record in a history table. The table format for the history table is the same as the main table, except for an additional sequential number to make the key unique (history table may have same record multiple times if same record is updated many times).

My question, is using an 'instead of' trigger the way to go on this?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-09-23 : 17:10:31
A regular (after) trigger would be fine for this purpose.
Go to Top of Page

helpme
Posting Yak Master

141 Posts

Posted - 2010-09-23 : 19:07:56
Thanks robvolk
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-09-24 : 03:46:36
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=170215
Go to Top of Page

helpme
Posting Yak Master

141 Posts

Posted - 2010-09-27 : 07:13:01
Thanks Kristen
Go to Top of Page
   

- Advertisement -