May 21, 2011 at 3:29 am
Hi,
create table dbo.example
(
num int
,name varchar(10)
,age int
,sal float
)
insert into dbo.example
select 1,'fff',24,10000 union all
select 2,'ggg',25,20000 union all
select 3,'hhh',26,30000 union all
select 4,'jjj',27,40000
go
create view dbo.vw_example with schemabinding
as
select
num
,name
,age
,sal
from dbo.example
go
-- updating one field
update dbo.example
set name='zzz'
where num=1
requirement:
when any field from table gets update
I need to select
with entire row with old value and
with entire row with new value
as below.....
status num name sal
old 1fff2410000
new 1zzz2410000
can i guide me how can i track old value...
actual requirement is one view depends on 10+ tables.
any filed from any table gets update from front end application .
when i run that view I need show with entire row old value and with entire row with new value
can I go for triggers on views.
May 21, 2011 at 3:58 am
In SS2K5 you could use a trigger and insert the the data of the internal tables INSERTED and DELETED into an audit table.
Your view would be based on the 10 audit tables.
May 22, 2011 at 1:17 am
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply