MSSQL -- sysobject, sp_helptext

Source: Internet
Author: User

SQL ServerThe table, view, stored procedure, and other database object information in the system tableSysobjects. Therefore, you can querySysobjectsDisplays the views, system tables, user tables, and stored procedures in the current database.

For example:

Select   *   From Sysobject Where Type = ' V '   And Type = ' S '   And Type = ' U '   And Type = ' P '

 

V indicates the view, s indicates the system table, u indicates the user table, and P indicates the stored procedure.

 

In addition, SQL Server alsoProvides"Sp_helptextSystem stored procedures to view the text of rules, default values, unencrypted stored procedures, user-defined functions, triggers, or views. Therefore, you can useSp_helptextSystem stored procedures to view the definition of stored procedures, views, and so on.

Command Format:

 Sp_helptext[@ Objname =] 'Name'

 

Note:Sp_helptextIs a keyword,[
@ Objname =] 'name'Is the object name. The object must exist in the current database.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.