I am having trouble using a user defined table type as a parameter type to a temporary stored procedure.
I am doing all of this within the database that houses our temp tables, temp stored procedures,... temp anything.
The code looks like this:
CREATE TYPE test_type AS TABLE (user int, user_value int)
GO
CREATE PROCEDURE #test_pro
@input test_type READONLY
AS
SELECT TOP 10 *
FROM @input
GO
I get the error:
Parameter or variable @input has an invalid data type.
Is there a way for me to use the data type test_type as a type in my temporary stored procedure? I unfortunately only have access to temporary stored procedures and not the permanent version.
Side question: would using a function work any better?