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
 General SQL Server Forums
 New to SQL Server Programming
 select records to be updated

Author  Topic 

ra_pa_ta
Starting Member

13 Posts

Posted - 2011-09-26 : 19:17:55
how do I write a query to select records into a archive table before the record is updated?

this is the update statement :

Update A Set A.ID = T.ID,A.Desc = T.Desc,A.Type = T.Type,
A.strStatus = T.strStatus,A.smnyDecrementRate =
From dbo.tblFinal As A
Inner Join dbo.tblInitial As T on T.ID = A.ID

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-09-26 : 19:21:56
You should checkout the OUTPUT clause: http://msdn.microsoft.com/en-us/library/ms177564.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-27 : 00:37:08
select records into a archive table before the record is updated?
why before update? what happens if update is rolledback?
or do you mean values in table fields prior to update?


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -