I want to set @inputData
as the rows of a select statement, then pass it into my DoSomething
stored procedure:
DECLARE @inputData [dbo].[TestTableType];
SET @inputData = (
SELECT
1 AS Client_Id,
20170202 AS a,
18595 AS b,
49.82 AS c,
88 AS d,
31 AS e,
0.67 AS f,
0 AS g,
44 AS h,
1827 AS i,
5 AS j,
87 AS k
);
EXEC DoSomething @inputData;
But I get this error:
Msg 137, Level 16, State 1, Line 3
Must declare the scalar variable "@inputData".
What am I doing wrong?
insert into @inputData select ...
– user1429080