如何判断sql数据表中是否更新
现在想判断数据库中的数据表是否更新,有什么办法吗?
------解决方案--------------------建一个表保存表里的记录数,每次查询完以后更新这个表
create table jl(tbname char (20),rows int )
truncate table jl
insert into jl
SELECT TOP 100 Percent
sysobjects.name,
sysindexes.rows
FROM sysindexes with(nolock)
JOIN sysobjects with(nolock)
ON sysindexes.id = sysobjects.id AND sysobjects.xtype = 'u'
WHERE sysindexes.indid in(0, 1)
select a.*,b.*
from jl a,(SELECT TOP 100 Percent
sysobjects.name,
sysindexes.rows
FROM sysindexes with(nolock)
JOIN sysobjects with(nolock)
ON sysindexes.id = sysobjects.id AND sysobjects.xtype = 'u'
WHERE sysindexes.indid in(0, 1) ) b
where a.tbname=b.name and a.rows<>b.rows and b.name<>'jl'