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
 update log

Author  Topic 

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2008-06-18 : 06:52:44
example code:

declare @temp table
(id int,
t_text varchar(10)
)

insert into @temp (id, t_text) values (1, 'ten')
insert into @temp (id, t_text) values (2, 'eleven')

select * from @temp

update @temp
set t_text = 'twelve'
where id = 2

select * from @temp


is it possible to see which records have been changed/updated without running select. Is there a function or procedure to see update/insert?

thank you in advance

p.s.: i'm using SQl server 2000 / 2005

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2008-06-18 : 07:03:33
In 2005, you can use OUTPUT directly after the update to see certain fields. See UPDATE in BOL (Books Online).
Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2008-06-18 : 07:09:34
and in 2000? any ideas?
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2008-06-18 : 07:31:26
Not sure in 2000, I don't think you can without a trigger to check the inserted and updated tables.
Go to Top of Page
   

- Advertisement -