Home  >  Article  >  Database  >  sqlSERVER 查询系统表 函数 存储过程

sqlSERVER 查询系统表 函数 存储过程

WBOY
WBOYOriginal
2016-06-07 15:25:051177browse

查询表: select * from sys.objects where type='U' 查询存储过程 select * from sys.objects where type='P' 查询存储过程的内容 EXEC Sp_HelpText '存储过程name' 查询自定义函数 select * from dbo.sysobjects WHERE xtype='AF' 查询自定义函数的内容 EXE


查询表:

select * from sys.objects where type='U'


查询存储过程

select * from sys.objects where type='P'

查询存储过程的内容

EXEC Sp_HelpText  '存储过程name'


查询自定义函数
select * from dbo.sysobjects  WHERE xtype='AF'

查询自定义函数的内容

EXEC Sp_HelpText  '自定义函数name'



还有其他的类型  可这样查看

select xtype from dbo.sysobjects  GROUP BY xtype

 

也可以用select * from sys.sql_modules查看内容

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn