how to pass multiple rows using a single column in a stored procedure in SQL (SSMS)? or how to pass single column values in a procedure.
CREATE TYPE tblAge_Type as TABLE
(
ID int,
Age int
)
--------------------------------------------------------------------------------------
alter PROCEDURE spAddAge (
@datasource tblAge_Type READONLY)
AS
update tblAge set Age = (select Age from @datasource ) where Id = (select ID from @datasource )
GO
------------------------------------------------------------------------------------------
DECLARE @data AS tblAge_Type
INSERT into @data VALUES(1,22) ;
INSERT into @data VALUES(2,55) ;
INSERT into @data VALUES(3,44);
EXEC spAddAge @data
getting this error: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.