Home > Software design >  How to pass User defined table type values to Value field for the Execute Procedure in SQL Server Ma
How to pass User defined table type values to Value field for the Execute Procedure in SQL Server Ma

Time:09-21

enter image description here

I have a few value types as parameters to my stored procedure, I am not sure how to input their values into the Value field of SSMS. Can anyone provide me with the sample? Is it like JSON or Name/Value pair?

CodePudding user response:

You need to perform through Query

DECLARE @FromFieldDefinitions DFFromFieldDefinition
DECLARE @FieldDefitions DFFieldDefinition
DECLARE @ListParameters DFFieldDefinition
DECLARE @DataBindingParameters DFFieldDefinition

   

INSERT INTO @FromFieldDefinitions values (1, <value1..>, <value2..>)
INSERT INTO @FromFieldDefinitions values (2, <value1..>, <value2..>)
INSERT INTO @FromFieldDefinitions values (3, <value1..>, <value2..>)
INSERT INTO @FromFieldDefinitions values (4, <value1..>, <value2..>)

INSERT INTO @FieldDefitions values (1, <value1..>, <value2..>)
INSERT INTO @FieldDefitions values (2, <value1..>, <value2..>)
INSERT INTO @FieldDefitions values (3, <value1..>, <value2..>)
INSERT INTO @FieldDefitions values (4, <value1..>, <value2..>)

INSERT INTO @ListParameters values (1, <value1..>, <value2..>)
INSERT INTO @ListParameters values (2, <value1..>, <value2..>)
INSERT INTO @ListParameters values (3, <value1..>, <value2..>)
INSERT INTO @ListParameters values (4, <value1..>, <value2..>)


INSERT INTO @DataBindingParameters values (1, <value1..>, <value2..>)
INSERT INTO @DataBindingParameters values (2, <value1..>, <value2..>)
INSERT INTO @DataBindingParameters values (3, <value1..>, <value2..>)
INSERT INTO @DataBindingParameters values (4, <value1..>, <value2..>)


EXEC Yoursp <other_params>,@FromFieldDefinitions,@FieldDefitions,@ListParameters,@DataBindingParameters,<other_params>
  • Related