Default values of procedure/function parameters are not stored in catalog views - by Pawel Potasinski, MSFT

Status : 


Sign in
to vote
ID 362784 Comments
Status Active Workarounds
Type Bug Repros 4
Opened 8/21/2008 5:22:36 AM
Access Restriction Public
Primary Feedback Item 234143


Default values for parameters of stored procedures and functions are not stored in catalog views.
Sign in to post a comment.
Posted by Umachandar [MSFT] on 8/22/2008 at 2:18 PM
I have captured your request in an existing suggestion. See link below:

So I am resolving this request as duplicate.


Posted by Umachandar [MSFT] on 8/22/2008 at 10:00 AM
I did not say that we cannot do the parsing and persist the default value at time of creation/alter. As I said, we will consider your request for a future version of SQL Server.

Umachandar, SQL Programmability Team
Posted by Pawel Potasinski, MSFT on 8/21/2008 at 1:15 PM
But when I use the function like this:

select dbo.fnTest(default)

SQL Server has to parse it to get the default value. I see no reason why SQL Server could not parse the definition during object creation and put the proper default values into system tables.

Pawel Potasinski, SQL Server MVP
Posted by Umachandar [MSFT] on 8/21/2008 at 11:07 AM
Thanks for your suggestion. We will consider it for a future version of SQL Server. Currently, the definitions for procedures, functions, triggers and views are stored as is in the catalog tables. They are used at the time of compilation/execution directly. So there is no way to get the default value for parameters of SPs, and functions other than parsing the text.

Umachandar, SQL Programmability Team