SQL查询出表、存储过程、触发器的创建时间和最后修改时间示例

2024-11-24 64阅读 0评论
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--查询建立时间
 
--表
 
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'dqtx') and xtype='P'
 
 
 
--查询最后修改时间
 
--存储过程
 
select name,modify_date from sys.all_objects where name = '存储过程' and type='P' order by modify_date desc
 
--触发器
 
select name,modify_date from sys.all_objects where name = '存储过程' and type='TR' order by modify_date desc
 
--表
 
select * from sys.all_objects where name = '存储过程' and type='u' order by modify_date desc
文章版权声明:除非注明,否则均为奥多云原创文章,转载或复制请以超链接形式并注明出处。

发表评论

快捷回复: 表情:
评论列表 (暂无评论,64人围观)

还没有评论,来说两句吧...

取消
微信二维码
微信二维码
支付宝二维码