declare @UserList varchar(100);
select @UserList = coalesce(@UserList+',', '') + UserID from account where UserID like 'Bob%';
select @UserList;
This would return the comma delimited list of UserIDs, that all start with Bob.
http://www.sqlteam.com/item.asp?ItemID=2368