A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
If you are using SQL Server 2016 or higher, then you can use the STRING_SPLIT (Transact-SQL) function for a set based solution, no need to loop =>
DECLARE @Str VARCHAR(100);
SET @Str = '22,45,50,105'
SELECT *
FROM STRING_SPLIT(@Str, ',') AS result