当前位置:Gxlcms > 数据库问题 > SQL 查找存储过程及视图与自带函数

SQL 查找存储过程及视图与自带函数

时间:2021-07-01 10:21:17 帮助过:4人阅读


select * from sysobjects
where type=‘P‘

查看存储过程定义语句
sp_helptext [存储过程名]

查看所有视图及信息
select * from sysobjects
where type=‘V‘

SQL自带函数
exec sp_databases; --查看数据库
exec sp_tables;        --查看表
exec sp_columns student;--查看列
exec sp_helpIndex student;--查看索引
exec sp_helpConstraint student;--约束
exec sp_stored_procedures;
exec sp_helptext ‘sp_stored_procedures‘;--查看存储过程创建、定义语句
exec sp_rename student, stuInfo;--修改表、索引、列的名称
exec sp_renamedb myTempDB, myDB;--更改数据库名称
exec sp_defaultdb ‘master‘, ‘myDB‘;--更改登录名的默认数据库
exec sp_helpdb;--数据库帮助,查询数据库信息
exec sp_helpdb master;

SQL 查找存储过程及视图与自带函数

标签:

人气教程排行