您的位置:首页 > 其它

查看数据最后修改时间,建立时间

2014-11-27 20:13 246 查看
--查询建立时间
select * from sysobjects where id=object_id(N'表名') and xtype='U'  --表
select * from syscolumns where id=object_id(N'表名')  --表的结构
select * from sysobjects where id=object_id(N'存储过程名') and xtype='P'  --存储过程
--查询最后修改时间
DECLARE @UpDateTime datetime
set  @UpDateTime='2014-11-27'
select name,modify_date from sys.all_objects where type='P' and modify_date>@UpDateTime --存储过程
select name,modify_date from sys.all_objects where type='u' and modify_date>@UpDateTime --表
select name,modify_date from sys.all_objects where type='TR' and modify_date>@UpDateTime --触发器
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: