Is there a way to determine if a parameter in a stored proc has a default value (and thus not required) in code - .Net?

后端 未结 4 1444
闹比i
闹比i 2021-01-19 02:59

I am already pulling the parameters from the stored proc sent in like this:

 foreach (SqlParameter param in cmd.Parameters)
            {
               if (         


        
4条回答
  •  旧时难觅i
    2021-01-19 03:33

    If you are looking at developing tools for management of SQL Server objects then a better option may be SMO. It looks like you can get to the default value of a stored procedure parameter using the StoredProcedureParameter Class.

    http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.parameter.defaultvalue(v=SQL.100).aspx

提交回复
热议问题