I have a stored procedure like
CREATE PROCEDURE GetSerial (@param1 int, @param2 int)
AS
BEGIN
-- do some insert/updates, so I can't use function
DECLARE @value AS int;
SET @value = 3;
return @value;
END
Now I declare a table variable
DECLARE @Serials AS TABLE
(
ID int,
Value int
)
Now I wanna fill this table like
INSERT INTO @Serials (ID, Value)
SELECT 1, GetSerial(1,2) -- *How can I call this?
So, can anyone help me how can i call the GetSerial stored procedure inside the SELECT statement to fill my table?