Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.spt_procedure_params_return_values_view

  No additional text.


Syntax

create view sys.spt_procedure_params_return_values_view
as
    select
    -- begin (for doing joins)
        object_id                   = o.object_id,
        schema_id                   = o.schema_id,
        procedure_number            = case
                                        when o.type = 'P' then 1    -- default, other numbered versions are below
                                        else                   0    -- all UDFs have number of 0
                                      end,
        type                        = o.type,
    -- end (for doing joins)
        PROCEDURE_CATALOG           = db_name(),
        PROCEDURE_SCHEMA            = schema_name(o.schema_id),
        PROCEDURE_NAME              = o.name,
        PARAMETER_NAME              = convert(sysname,
                                                case
                                                when o.type = 'P' then '@RETURN_VALUE'
                                                else                   '@TABLE_RETURN_VALUE'
                                                end),
        ORDINAL_POSITION            = convert(smallint,0),
        PARAMETER_TYPE              = convert(smallint, 4), --DBPARAMTYPE_RETURNVALUE
        PARAMETER_HASDEFAULT        = convert(tinyint, 0),
        PARAMETER_DEFAULT           = convert(nvarchar(255),null),
        IS_NULLABLE                 = convert(bit,0),
        DATA_TYPE                   = convert(smallint,
                                                case
                                                when o.type = 'P' then 3 -- DBTYPE_I4
                                                else                   0 -- DBTYPE_EMPTY
                                                end),
        CHARACTER_MAXIMUM_LENGTH    = convert(int,null),
        CHARACTER_OCTET_LENGTH      = convert(int,null),
        NUMERIC_PRECISION           = convert(smallint,
                                                case
                                                when o.type = 'P' then 10
                                                else                   null
                                                end),
        NUMERIC_SCALE               = convert(smallint,null),
        DESCRIPTION                 = convert(nvarchar(50),
                                                case
                                                when o.type = 'P' then null
                                                else                   N'Result table returned by table valued function'
                                                end),
        TYPE_NAME                   = convert(sysname,
                                                case
                                                when o.type = 'P' then N'int'
                                                else                   N'table'
                                                end),
        LOCAL_TYPE_NAME             = convert(sysname,
                                                case
                                                when o.type = 'P' then N'int'
                                                else                   N'table'
                                                end),
        SS_XML_SCHEMACOLLECTION_CATALOGNAME = convert(sysname,null),
        SS_XML_SCHEMACOLLECTION_SCHEMANAME  = convert(sysname,null),
        SS_XML_SCHEMACOLLECTIONNAME = convert(sysname,null),
        SS_UDT_CATALOGNAME          = convert(sysname,null),
        SS_UDT_SCHEMANAME           = convert(sysname,null),
        SS_UDT_NAME                 = convert(sysname,null),
        SS_UDT_ASSEMBLY_TYPENAME    = convert(sysname,null) collate Latin1_General_BIN,
        SS_TYPE_CATALOG_NAME        = convert(sysname,null),
        SS_TYPE_SCHEMANAME          = convert(sysname,null),
        MANAGED_DATA_TYPE           = convert(smallint,
                                                case
                                               when o.type = 'P' then 8 -- SqlDbType.Int
                                                else                   23 -- SqlDbType.Variant
                                                end),
        SS_DATETIME_PRECISION       = convert(int,null)
    from
        sys.all_objects o -- we can not use sys.procedures, because it doesn't include system procedures :-(

    where
        o.type in ('P', 'TF', 'IF') -- SProcs/Table-valued UDFs/Inlined-table-valued UDFs

    UNION ALL

    select -- Generating @RETURN_VALUE for numbered SProcs.
    -- begin (for doing joins)
        object_id                   = pro.object_id,
        schema_id                   = pro.schema_id,
        procedure_number            = s_np.procedure_number,
        type                        = convert(char(2), 'P'),
    -- end (for doing joins)
        PROCEDURE_CATALOG           = db_name(),
        PROCEDURE_SCHEMA            = schema_name(pro.schema_id),
        PROCEDURE_NAME              = pro.name,
        PARAMETER_NAME              = convert(sysname, '@RETURN_VALUE'),
        ORDINAL_POSITION            = convert(smallint,0),
        PARAMETER_TYPE              = convert(smallint, 4), --DBPARAMTYPE_RETURNVALUE
        PARAMETER_HASDEFAULT        = convert(tinyint, 0),
        PARAMETER_DEFAULT           = convert(nvarchar(255),null),
        IS_NULLABLE                 = convert(bit,0),
        DATA_TYPE                   = convert(smallint, 3), -- DBTYPE_I4
        CHARACTER_MAXIMUM_LENGTH    = convert(int,null),
        CHARACTER_OCTET_LENGTH      = convert(int,null),
        NUMERIC_PRECISION           = convert(smallint, 10),
        NUMERIC_SCALE               = convert(smallint,null),
        DESCRIPTION                 = convert(nvarchar(50), null),
        TYPE_NAME                   = convert(sysname, N'int'),
        LOCAL_TYPE_NAME             = convert(sysname, N'int'),
        SS_XML_SCHEMACOLLECTION_CATALOGNAME = convert(sysname,null),
        SS_XML_SCHEMACOLLECTION_SCHEMANAME  = convert(sysname,null),
        SS_XML_SCHEMACOLLECTIONNAME = convert(sysname,null),
        SS_UDT_CATALOGNAME          = convert(sysname,null),
        SS_UDT_SCHEMANAME           = convert(sysname,null),
        SS_UDT_NAME                 = convert(sysname,null),
        SS_UDT_ASSEMBLY_TYPENAME    = convert(sysname,null) collate Latin1_General_BIN,
        SS_TYPE_CATALOG_NAME        = convert(sysname,null),
        SS_TYPE_SCHEMANAME          = convert(sysname,null),
        MANAGED_DATA_TYPE           = convert(smallint, 8), -- SqlDbType.Int
        SS_DATETIME_PRECISION       = convert(int,null)
    from
        sys.procedures pro inner join
        sys.numbered_procedures s_np on (s_np.object_id = pro.object_id)

 
Last revision 2008RTM
See also

  sp_procedure_params_90_rowset (Procedure)
sp_procedure_params_90_rowset2 (Procedure)
sp_procedure_params_rowset (Procedure)
sp_procedure_params_rowset2 (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