SQL Server 2005 中的系统视图文本 [英] System Views text in SQL Server 2005

查看:35
本文介绍了SQL Server 2005 中的系统视图文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在 SQL Server 2005 中使用对象资源管理器或 sp_helptext 查看系统视图和过程的文本.

I am looking for viewing the text of the system views and procedures in SQL Server 2005 using the object explorer or using sp_helptext.

实际上我来自SQL Server 2000背景,我们有直接使用SQL Server 2000企业管理器检索视图和存储过程的代码的功能,但我仍然无法在SQL中找到此功能Server 2005 Management Studio,并且仍在寻找用于在 SQL Server 2005 中获取视图和过程文本的相同功能.

actually i am coming from the SQL Server 2000 background, where we have the feature of retreiving the code of the view and the stored procedure using SQL Server 2000 Enterprise manager directly, but still i am unable to find this feature in the SQL Server 2005 Management Studio and still looking for the same feature for getting the view and procedure text in SQL Server 2005.

请帮我解决这个问题.

推荐答案

您是否有权访问 SQL Server Management Studio?现在是sys.sp_helptext,可以在master --> Programmability --> Stored Procedures --> System Stored Procedures在对象浏览器中浏览,用

Do you have access to SQL Server Management Studio? It is now sys.sp_helptext and can be browsed at master --> Programmability --> Stored Procedures --> System Stored Procedures in the object browser and executed with

exec sys.sp_helptext ObjectName

您要查找的所有信息都可以在 syscomments 表,它存储所有视图、规则、默认值、触发器、CHECK 约束、DEFAULT 约束和存储过程的定义.SQL 定义语句存储在文本"列中.

All the information you are looking for can be found in the syscomments table which stores the definitions of all views, rules, defaults, triggers, CHECK constraints, DEFAULT constraints, and stored procedures. The SQL definition statements are stored in the "text" column.

select text from syscomments  where id =
OBJECT_id('objectname')
order by colid

这篇关于SQL Server 2005 中的系统视图文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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