How to use SQL Server Management Studio - “Run a stored procedure" for custom table types?

I am trying to right-click a stored procedure in SQL Server Management Studio 2012 and try to execute a stored procedure that takes a single parameter of type tblType_XXX , which is a Custom Table Type . 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 SQL Server Management Studio - tblType_XXX stored procedure from the user interface?

tblType_XXX contains only one int column

+6
source share
1 answer

You need to declare a table variable, insert data into it, if necessary, call the stored procedure without using the @parameter = 1 format:

 DECLARE @return_value int, @tblParameter tblType_XXX INSERT INTO @tblParameter VALUES (1) EXEC @return_value = [dbo].[uspGetXXXXXXXX] @tblParameter 
+14
source

Source: https://habr.com/ru/post/949652/


All Articles