Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.spt_all_procedures

 

This is a view in the mssqlsystemresource database. It create's a list of all available stored procedures in the database.




Syntax

create view sys.spt_all_procedures
as
    -- For user procedures
    select
        name                = o.name,
        object_id           = o.object_id,
        schema_id           = o.schema_id,
        procedure_number    = p.procedure_number,
        type                = o.type,
        create_date         = o.create_date
    from
        sys.objects o join
        sys.numbered_procedures$ p on
            (
                p.object_id = o.object_id
            )
    where
        o.type in ('P', 'FN', 'TF', 'IF') -- Object type of Procedure

    union all

    -- For system procedures.
    -- We don't have info about numbered system procedures(sp_ddopen;2, etc.)
    select
        name                = o.name,
        object_id           = o.object_id,
        schema_id           = o.schema_id,
        procedure_number    = convert(smallint, -- not in sys.system_objects
                                       case     -- These conditions should match the ones in sys.spt_parameters_numbered_parameters
                                           when o.type = 'P' then 1
                                           else                   0 -- 'FN', 'TF', 'IF'
                                       end),
        type                = o.type,
        create_date         = o.create_date
    from
        sys.system_objects o
    where
        o.type in ('P', 'FN', 'TF', 'IF') -- Object type of Procedure


 
Last revision 2008RTM
See also

  spt_parameters_numbered_parameters (View)
spt_parameters_system (View)
spt_parameters_user (View)
spt_sproc_columns_return_values_odbc_view (View)
sp_procedures_rowset (Procedure)
sp_procedures_rowset2 (Procedure)
sp_stored_procedures (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash