declare @st nvarchar(2000) select @st='35,36' select * from Item where patindex('%,'+rtrim(ItemId)+',%',','+@st+',')>0