• There are no quotes around the names of your fruits so they are being interpreted as column names.

    if the string you passed in was like this,

    set @sql = ''''+'guava'+''''+','+''''+'orange'+''''

    it would work fine. That being said, you probably want to search for "string splitter" on here and use one of the prerolled methods for using comma delimited strings.