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.