I am wondering how to figure out if a store procedure has a certain parameter without a try catch. Basically we have a standard in our database where all of our stored procedures are Delete_<TableName> and a set number of parameters. Well we want to add a @ReturnValue to some but not all right away. Since it is a return value I have to add it to the stored proc because you can't make it optional. So I was wondering if there was a way to check the stored proc to see if @ReturnValue has been defined.
Is that possible?
Dim nCmd As New SqlClient.SqlCommand("Delete_" & TableName)
nCmd.CommandType = CommandType.StoredProcedure
'Need logic to check to see if @ReturnValue is on Delete_<TableName>
nCmd.Parameters("@ReturnValue").Direction = ParameterDirection.Output
nCmd.Parameters("@ReturnValue").Size = 250