Where can I find information about stored procedure parameters? In my situation I need to know only the input parameters of given store procedure.
In the sys.objects
there is only common details about the procedure. In sys.sql_modules
I can extract the whole SQL text of a procedure.
As (in SQL Server Management studio) I am able to extract information about the parameters in tabular view using ALT+F1
when selecting the procedure name. I hope there is some place from which I can extract input parameters details in that way.
To view the default value of a parameter in a Transact-SQL object, query the definition column of the sys. sql_modules catalog view, or use the OBJECT_DEFINITION system function.
Parameters are used to exchange data between stored procedures and functions and the application or tool that called the stored procedure or function: Input parameters allow the caller to pass a data value to the stored procedure or function.
Expand Databases, expand the database in which the procedure belongs, and then expand Programmability. Expand Stored Procedures, right-click the procedure and then select Script Stored Procedure as, and then select one of the following: Create To, Alter To, or Drop and Create To. Select New Query Editor Window.
As a program, a stored procedure can take parameters. There are three types of parameters: IN, OUT and INOUT.
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('MySchema.MyProcedure')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With