查詢建立時間
-- 表
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 '
查詢最后修改時間
-- 存儲過程
select name,modify_date from sys.all_objects where type = ' P ' order by modify_date desc
-- 觸發器
select name,modify_date from sys.all_objects where type = ' TR ' order by modify_date desc
-- 表
select * from sys.all_objects where type = ' u ' order by modify_date desc
-- 表
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 '
查詢最后修改時間
-- 存儲過程
select name,modify_date from sys.all_objects where type = ' P ' order by modify_date desc
-- 觸發器
select name,modify_date from sys.all_objects where type = ' TR ' order by modify_date desc
-- 表
select * from sys.all_objects where type = ' u ' order by modify_date desc
