I am looking for a way to list any default values for stored procedure
parameters.
For example with this stored procedure:
CREATE PROC dbo.pr_GetSomeData
(
@.SomeInt int,
@.AnotherInt int = 0,
@.SomeDate datetime = NULL
)
I'd like to be able to create a table that would look like this
ParameterName DefaultValue
@.SomeInt
@.AnotherInt 0
@.SomeDate NULL
I can get at the parameters themselves through information_schema.PARAMETERS
but I don't see a way to get at the default value.
Any suggestions would be appreciated.
Joel Reinford
Data Management Solutions LLCSQL Server does not store information about this in any sys table. One
possible solution could be parsing the sp code from syscomment or
information_schema.routines for the sp in question.
AMB
"Joel Reinford" wrote:
> I am looking for a way to list any default values for stored procedure
> parameters.
> For example with this stored procedure:
> CREATE PROC dbo.pr_GetSomeData
> (
> @.SomeInt int,
> @.AnotherInt int = 0,
> @.SomeDate datetime = NULL
> )
> I'd like to be able to create a table that would look like this
> ParameterName DefaultValue
> @.SomeInt
> @.AnotherInt 0
> @.SomeDate NULL
> I can get at the parameters themselves through information_schema.PARAMETE
RS
> but I don't see a way to get at the default value.
> Any suggestions would be appreciated.
>
> Joel Reinford
> Data Management Solutions LLC
>
>
No comments:
Post a Comment