数据库
首页 > 数据库> > Sqlserver 查询最新修改过的表、过程和视图等

Sqlserver 查询最新修改过的表、过程和视图等

作者:互联网

--SELECT A.[type],A.type_desc FROM sys.objects A GROUP BY A.[type],A.type_desc

GO

DECLARE @bTime AS DATETIME

SET @bTime='2021-11-23'

--存储过程

SELECT * FROM sys.objects A WHERE A.[type]='P' AND A.modify_date>=@bTime ORDER BY A.modify_date DESC

--表

SELECT * FROM sys.objects A WHERE (A.[type]='S' OR A.[type]='IT' OR A.[type]='U') AND A.modify_date>=@bTime ORDER BY A.modify_date DESC

--函数

SELECT * FROM sys.objects A WHERE (A.[type]='FN' OR A.[type]='TF') AND A.modify_date>=@bTime ORDER BY A.modify_date DESC

--视图

SELECT * FROM sys.objects A WHERE A.[type]='V' AND A.modify_date>=@bTime ORDER BY A.modify_date DESC

 

GO

标签:modify,Sqlserver,视图,查询,bTime,objects,date,type,SELECT
来源: https://www.cnblogs.com/songjuntao/p/15595052.html