SQL如何查看DB中的表列表,表中的列,存储过程 [英] SQL how to view the list of tables in DB, the columns in the table, stored procedure

查看:63
本文介绍了SQL如何查看DB中的表列表,表中的列,存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查看存储过程中的代码?我应该拥有哪些权限。


另外如何获取数据库中的表列表?

How do i view the code in stored procedure?what permission should I have for it.

Also how do I get the list of tables in the DB?

推荐答案

1。
展开 | 选择 | Wrap | 行号



1.
展开 | 选择 | Wrap | 行号


大家好,


谢谢


select * from information_schema .tables where table_type ='''base table''


select * from sysobjects type =''p''

上面的查询工作


非常感谢





我试过sp_helptext''spname''


但它返回了


服务器:消息15009,级别16,状态1,过程sp_helptext,第54行

对象'' spname''在数据库''autodb'中不存在或者对于此操作无效。

但是当我运行以下查询时这个sp就存在了

select * from sysobjects where type =''p''


我在DB中只有读取权限...可能是因为这个我无法查看它?


如何在数据库中找到我的权限?


非常感谢您的帮助
Hi all,

Thanks

select * from information_schema.tables where table_type = ''base table''

select * from sysobjects where type=''p''
the above query worked

Thanks a lot

But

I tried sp_helptext ''spname''

But it returned

Server: Msg 15009, Level 16, State 1, Procedure sp_helptext, Line 54
The object ''spname'' does not exist in database ''autodb'' or is invalid for this operation.
But this sp is there when I run the below query
select * from sysobjects where type=''p''

I have only Read permissions in the DB... may be because of this I am not able to view it?

How do I find my permission in the DB?

Thanks a lot for your help


这篇关于SQL如何查看DB中的表列表,表中的列,存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆