SELECT modify_date FROM SYS.OBJECTS WHERE object_id=OBJECT_ID('table_Name')
select * from sys.all_objects where type='u'
大致意思是: select min(modify_date) from Accounting.sys.objects 其中Accounting是几百个数据库中的一个,我想查所有数据库的min(modify_date).
虽然结贴了,自己总结一下吧。create table #temp(dbname sysname, max_modifydate datetime) insert into #temp exec sp_MSforeachdb 'if ''?'' not in (''master'',''model'',''msdb'',''tempdb'') select ''?'', max(modify_date) from ?.sys.objects' select * from #temp order by dbname drop table #temp还有就是使用游标,就不表述了。
大致意思是:
select min(modify_date) from Accounting.sys.objects
其中Accounting是几百个数据库中的一个,我想查所有数据库的min(modify_date).
insert into #temp
exec sp_MSforeachdb 'if ''?'' not in (''master'',''model'',''msdb'',''tempdb'')
select ''?'', max(modify_date) from ?.sys.objects'
select * from #temp order by dbname
drop table #temp还有就是使用游标,就不表述了。