How to get all parameter names along with their values in stored procedure which is being executed -
I am using SQL Server 2012, any possible way of obtaining all the parameters of a stored procedure with values Is it passed to?
I need these things to create an XML I mean that it should be in the process which is being executed and it should be normal for all processes. For example, suppose we have procedures,
-
USPsave, @name = 'test' @ age = 20
UspDelete @ id = 2
Now in the
uspSave process, let me see the
@name, @age and value ' ', 20 and need to get the
uspDelete , with me the value of
@ id
To get the column name, I tried to do this,
Name parameter_schema.PARAMETERS, where parameter_name = OBJE Now it is possible to loop through the result of the above queries and we can get the value.
P>
- Create the XML-ify of the parameter without your code
- If a quick knock script (can be done in TSQL), then create a SPOK-specific block of TSQL, Convert parameters to XML using Information_SChama.
- Change your Copy the auto-generated script into SprayC
The way you were thinking with dynamic SQL, it will not work due to the scope - Parameters will be dynamically generated SQL You will have to pass them through SPX in the form of ARG, which puts you back into class 1.
For example
DECLARE @ Someval int = 7 EXECUTE ('SELECT @someval') - @ not in the scope of time
So, if it helps save time, the code general looks like your best bet.
Comments
Post a Comment