• I couldn't find a way of doing this in an iTVF.

    If you execute the following:

    sp_executesql N'select * from products where name like @ProdName'

    ,N'@ProdName varchar(30)'

    ,@ProdName = 'Samsung%'

    You'll get the idea of how to do this sort of thing, while protecting yourself a little from SQL Injection. It would work fine in a stored proc ...

    --Edit: oh and by the way, using char(n) for a column of variable length is generally best avoided, as all 'n' bytes will always get used, so a varchar(n) might be better in your examples.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.