Use the SetToArray, StrToSet, and SetToStr functions.
Use the "Search" tab in the enterprise manager for examples.
I don't have any quick samples of my own as a reference for you. However,
I believe you can accomplish what you need with these three commands.