• @GrassHopper

    I realise this is not strictly on topic but we use a very similar tactic but instead use varchar(8000) parameters using a dbo.Split function which utilises a number table. This removes the need for a loop in your function. Also why varbinary over a varchar(8000) or similar?