[英]How to use SQL Server Management studio - “Execute Stored Procedure” for User Defined Table Types?
I am trying to right click a stored procedure in SQL Server Management Studio 2012 and trying to execute a stored procedure which accepts a single parameter of type tblType_XXX
which is a User Defined Table Type . 我试图右键单击SQL Server Management Studio 2012中的存储过程并尝试执行一个存储过程,该存储过程接受类型为tblType_XXX
的单个参数,这是一个用户定义的表类型 。 But when I try to pass a single value I get this error 但是当我尝试传递单个值时,我得到了这个错误
Msg 206, Level 16, State 2, Procedure uspGetXXXXXXXX, Line 0
Operand type clash: int is incompatible with tblType_XXX
How can I specify a parameter of type tblType_XXX
in the SQL Server Management Studio -> Execute Stored Procedure from the UI? 如何在tblType_XXX
中的SQL Server Management Studio - > 执行存储过程中指定类型为tblType_XXX
的参数?
tblType_XXX
only contains one column of type int
tblType_XXX
只包含一个int
类型的列
You need to declare table variable, insert data into it if needed, call your stored procedure not using @parameter = 1
format: 您需要声明表变量,如果需要,将数据插入其中,不使用@parameter = 1
格式调用存储过程:
DECLARE @return_value int,
@tblParameter tblType_XXX
INSERT INTO @tblParameter VALUES (1)
EXEC @return_value = [dbo].[uspGetXXXXXXXX]
@tblParameter
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.