HamedFathi
HamedFathi

Reputation: 3969

How can I get All information about Functions specially parameters in SQL Server?

I need to know How can I get all Information specially name,type,order and IsOutput of All parameters of functions in SQL Server ?

for example something like :

ufnGetContactInformation() in AdventureWorks2014

ParameterName   Type    Order
@PersonID       int     1     

Upvotes: 1

Views: 38

Answers (1)

nrussell
nrussell

Reputation: 18602

I think this should do it:

USE AdventureWorks2012;

SELECT  o.name AS [Function Name]
       ,p.is_output
       ,p.name AS [Parameter Name]
       ,p.parameter_id AS [Parameter Number]
       ,t.name AS [Parameter Type]
FROM    sys.objects o
        INNER JOIN sys.parameters p ON o.object_id = p.object_id
        INNER JOIN sys.types t ON p.system_type_id = t.system_type_id
WHERE   o.type = 'FN'
ORDER BY o.name
       ,p.parameter_id;

Upvotes: 3

Related Questions