Default values of procedure/function parameters are not stored in catalog views
Default values for parameters of stored procedures and functions are not stored in catalog views.

Upvotes: 16
<=-=Aug 21 2008 11:07AM=-=>Hi,
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
Hi,
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.
Regards,
Pawel Potasinski, SQL Server MVP
Hi,
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
Hi,
I have captured your request in an existing suggestion. See link below:
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=234143
So I am resolving this request as duplicate.Thanks
Umachandar