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.
As you can see, we have displayed the Stored Procedure parameters in detail.
Good luck to everyone in business and life.