x00
x00

Reputation: 103

SQL Server : call function with parameter names

Is there a way to call a SQL Server / T-SQL function using parameter names?

Something like:

select dbo.function1 (@par1 = 1, @par2 = 2)

It is possible to do so with stored procedures.

Upvotes: 5

Views: 5873

Answers (2)

Silvère LHERMITE
Silvère LHERMITE

Reputation: 51

Seems to be possible only with EXEC statement:

EXEC @ret = dbo.function1 @par1 = 1, @par2 = 2

See MSDN

Upvotes: 3

Gaspa79
Gaspa79

Reputation: 5615

No, there's no named arguments when calling functions I'm afraid. As you said before, there is in stored procedures.

Upvotes: 4

Related Questions