--查询建立时间
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 --触发器查看数据最后修改时间,建立时间
最新推荐文章于 2024-08-26 03:17:13 发布
本文介绍如何使用SQL查询SQL Server中表、存储过程和触发器的创建及最后修改时间,包括具体SQL语句示例。
1万+

被折叠的 条评论
为什么被折叠?



