SQL 查找存储过程中出现过的文字怎么查询

SQL 查找存储过程中出现过的文字怎么查询,第1张

在syscomments系统表里查,结合sysobjects系统表取得过程名

select bname

from 数据库名dbosyscomments a,数据库名dbosysobjects b where aid=bid and bxtype='p' and atext like '%insert into%'

“数据库名”替换成你实际的数据库名,因为每个数据库里的存储过程都是单独保存在自己数据库的syscomments表内,所以要加上数据库名,这样就不用在切换数据库上下文了。另外加密的存储过程是查不出来的。

查询 MySql 数据库中所有表名:

select table_name from information_schematables where table_schema='当前数据库名' and table_type='base table';

查询 MySql 指定数据库中指定表的所有字段名:

select column_name from information_schemacolumns where table_schema='当前数据库名' and table_name='指定的表名';

扩展资料

查询所有数据库

show databases;

查询指定数据库中所有表名

select table_name from information_schematables where table_schema='database_name' and table_type='base table';

查询指定表中的所有字段名

查询指定表中的所有字段名和字段类型

select column_name,data_type from information_schemacolumns where table_schema='database_name' and table_name='table_name';

以上就是关于SQL 查找存储过程中出现过的文字怎么查询全部的内容,包括:SQL 查找存储过程中出现过的文字怎么查询、如何在sqlserver中查找某个表所有字段值、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/10159640.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-05
下一篇2023-05-05

发表评论

登录后才能评论

评论列表(0条)

    保存