2个回答
展开全部
视图
SQL Server
select
a.name AS ViewName,
c.text AS CreateViewSQL
from
sys.views a
LEFT OUTER JOIN
dbo.syscomments c ON a.object_id = c.id
order by
a.name
MySQL
是否是视图 通过 table_type 字段是否为 VIEW 来区分的。
SELECT
table_name AS `视图名`,
table_type AS `类型`,
engine AS `引擎`,
table_comment AS `备注`
FROM
information_schema.tables
WHERE
table_schema = 'test' AND table_type = 'VIEW'
ORDER BY
table_name DESC;
存储过程
SQL Server
select
pro.name AS ProcedureName,
c.text AS CreateProcedureSQL
from
sys.procedures pro LEFT OUTER JOIN
dbo.syscomments c ON pro.object_id = c.id
MySQL 里面,查存储过程的,我这里暂时没有。
SQL Server
select
a.name AS ViewName,
c.text AS CreateViewSQL
from
sys.views a
LEFT OUTER JOIN
dbo.syscomments c ON a.object_id = c.id
order by
a.name
MySQL
是否是视图 通过 table_type 字段是否为 VIEW 来区分的。
SELECT
table_name AS `视图名`,
table_type AS `类型`,
engine AS `引擎`,
table_comment AS `备注`
FROM
information_schema.tables
WHERE
table_schema = 'test' AND table_type = 'VIEW'
ORDER BY
table_name DESC;
存储过程
SQL Server
select
pro.name AS ProcedureName,
c.text AS CreateProcedureSQL
from
sys.procedures pro LEFT OUTER JOIN
dbo.syscomments c ON pro.object_id = c.id
MySQL 里面,查存储过程的,我这里暂时没有。
展开全部
select * from all_objects where object_type = 'VIEW';
--这个SQL能查出数据库下面所有的视图信息
select * from all_objects where object_type = 'PROCEDURE';
--这个SQL能查出数据库下面所有的存储过程的信息
--这个SQL能查出数据库下面所有的视图信息
select * from all_objects where object_type = 'PROCEDURE';
--这个SQL能查出数据库下面所有的存储过程的信息
追问
在SqlServer数据库和MySql数据库中也是这样?????????
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询