@chanum int,
@search varchar(max)
AS
BEGIN
SET NOCOUNT ON;
SELECT ChaInven FROM ChaInfo WHERE ChaNum = @chanum AND ChaInven LIKE '%' + @search + '%'
END
SELECT ChaInven FROM RanGame1.dbo.ChaInfo WHERE ChaNum = @chanum AND CONVERT(varchar(max),cast(ChaInven as varbinary(max))) LIKE '%' + CONVERT(varchar(max),CONVERT(VARBINARY(max),@search,1)) + '%'