Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the SQL Server system table that contains information about stored procedure parameters?

What is the SQL Server system table that contains information about stored procedure parameters with it's information like datatype, name, lenght, null or not?

thanks

like image 826
AmandaSai98b Avatar asked May 04 '12 14:05

AmandaSai98b


People also ask

Which system procedure is used to describe the contents of a table?

Since in database we have tables, that's why we use DESCRIBE or DESC(both are same) command to describe the structure of a table. Syntax: DESCRIBE one; OR DESC one; Note : We can use either DESCRIBE or DESC(both are Case Insensitive).

What is parameter table in SQL?

Table-valued parameters are declared by using user-defined table types. You can use table-valued parameters to send multiple rows of data to a Transact-SQL statement or a routine, such as a stored procedure or function, without creating a temporary table or many parameters.

What are system stored procedures in SQL Server?

SQL Server stored procedure is a batch of statements grouped as a logical unit and stored in the database. The stored procedure accepts the parameters and executes the T-SQL statements in the procedure, returns the result set if any.


2 Answers

You can query sys.procedures and sys.parameters...

select pr.name, p.*
from sys.procedures pr 
inner join sys.parameters p on pr.object_id = p.object_id

And join to types too...

select pr.name, p.*, t.name, t.max_length
from sys.procedures pr 
inner join sys.parameters p on pr.object_id = p.object_id
inner join sys.types t on p.system_type_id = t.system_type_id
like image 86
grapefruitmoon Avatar answered Sep 23 '22 23:09

grapefruitmoon


You can also use

select * from INFORMATION_SCHEMA.PARAMETERS
like image 30
David Brabant Avatar answered Sep 23 '22 23:09

David Brabant