I have a stored procedure,
CREATE PROCEDURE [dbo].[SReport]
(
@.ListByBatch BIT,
@.UnPrintedOnly BIT = 1
)
AS
............................
........
I can find the information regarding parameters of this Stored Procedure from "syscolumns" or
"Information_Schema.Parameters" system tables. These tables provides information about parametername, datatype ...etc. But dont provide information about default values for these parameters.
Here i have assigned a value, Does SQL Server stores this value?
Does SQL Server maintains information about Default Values for Parameter ? (For tables it maintains the default value for a column).
Is there any way , i can find All parameter information for a stored procedure including Default value..........?
Hi,you can try sp_procedure_params_rowset
sp_procedure_params_rowset will return the following result set.
PROCEDURE_CATALOG
|||
Hi,
Thanks for reply.
I tried this , But it shows NULL for PARAMETER_DEFAULT and 0 for PARAMETER_HASDEFAULT though i have set default value for that parameter.
Is there any other way , we can find this default value?
|||SQL SERVER does not store the default parameter values for transact sql stored procedure. It does so for clr stored procedures. See here
http://msdn2.microsoft.com/en-us/library/ms176074.aspx
In SQL SERVER 2005, You can use object_definition() function to get the definition of the procedure and then parse it to get the default parameter values.
In SQL 2K, the syscomments system table stores the definitions for the various stored procedures.
No comments:
Post a Comment