Viewing Stored Procedure Parameters in Detail in SQL Server

Hello everyone,

In this article, I will try to give information about displaying Stored Procedure parameters in SQL Server in detail.

In SQL Server, in some cases, you may want to view the Stored Procedure parameters in detail.

You can easily do this using the code below.

SELECT 'Parameter_name' = name,
       'Type' = TYPE_NAME(user_type_id),
       'Length' = max_length,
       'Prec' = CASE
                    WHEN TYPE_NAME(system_type_id) = 'uniqueidentifier' THEN
                        precision
                    ELSE
                        OdbcPrec(system_type_id, max_length, precision)
                END,
       'Scale' = OdbcScale(system_type_id, scale),
       'Param_order' = parameter_id,
       'Collation' = CONVERT(   sysname,
                                CASE
                                    WHEN system_type_id IN ( 35, 99, 167, 175, 231, 239 ) THEN
                                        SERVERPROPERTY('collation')
                                END
                            )
FROM sys.parameters
WHERE OBJECT_ID = OBJECT_ID('dbo.CustOrderHist'); --Enter the procedure name here.

When you run the above code, you will see a result similar to the one below.

Viewing Stored Procedure Parameters in Detail in SQL Server

As you can see, we have displayed the Stored Procedure parameters in detail.

Good luck to everyone in business and life.

43 Views

Yavuz Selim Kart

I try to explain what I know in software and database. I am still improving myself by doing research on many programming languages. Apart from these, I am also interested in Graphic Design and Wordpress. I also have knowledge about SEO and Social media management. In short, I am a determined person who likes to work hard.

You may also like...

Don`t copy text!