我很好奇是否有一种方法可以查看我拥有的嵌套存储过程中插入语句中使用的变量值。例如,嵌套存储过程正在调用此语句,我想找到一种简单的方法来打印该列表。
INSERT INTO MyTable
(
[Rate1_Amt],
[Rate2_Amt],
[Rate3_Amt],
[Rate4_Amt],
[Rate5_Amt],
[Rate6_Amt],
[Rate7_Amt],
[Rate8_Amt],
[Rate9_Amt],
[Rate10_Amt]
)
VALUES
(
@rate1,
@rate2,
@rate3,
@rate4,
@rate5,
@rate6,
@rate7,
@rate8,
@rate9,
@rate10
)
所以想了解一种通过修改存储过程来打印@rate#变量列表的方法
最佳答案
**请尝试这个**
PRINT CAST(@rate1 as varchar(max))
PRINT CAST(@rate2 as varchar(max))
PRINT CAST(@rate3 as varchar(max))
PRINT CAST(@rate4 as varchar(max))
PRINT CAST(@rate5 as varchar(max))
PRINT CAST(@rate6 as varchar(max))
PRINT CAST(@rate7 as varchar(max))
PRINT CAST(@rate8 as varchar(max))
PRINT CAST(@rate9 as varchar(max))
PRINT CAST(@rate10 as varchar(max))
INSERT INTO MyTable
(
[Rate1_Amt],
[Rate2_Amt],
[Rate3_Amt],
[Rate4_Amt],
[Rate5_Amt],
[Rate6_Amt],
[Rate7_Amt],
[Rate8_Amt],
[Rate9_Amt],
[Rate10_Amt]
)
VALUES
(
@rate1,
@rate2,
@rate3,
@rate4,
@rate5,
@rate6,
@rate7,
@rate8,
@rate9,
@rate10
)
关于mysql - 打印存储过程中插入中使用的变量列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43352878/