The preferred method to pass an array of values ββto a stored procedure in an SQL server is to use table parameters.
First you define the type as follows:
CREATE TYPE UserList AS TABLE ( UserID INT );
Then you use this type in the stored procedure:
create procedure [dbo].[get_user_names]
@user_id_list UserList READONLY,
@username varchar (30) output
as
select last_name+', '+first_name
from user_mstr
where user_id in (SELECT UserID FROM @user_id_list)
, , :
DECLARE @UL UserList;
INSERT @UL VALUES (5),(44),(72),(81),(126)
, , SP:
EXEC dbo.get_user_names @UL, @username OUTPUT;