hmm, I couldn't get this to work properly. It seems that upon creating the function (modified the code a little):create function csvMaker(@name varchar(20),@id int)returns varchar(1000)ASbegindeclare @csv varchar(1000)select @csv = coalesce(@csv+',', '') + Title + ' ' + Departmentfrom tblwhere names = @nameand ids = @idreturn @csvendgo
And running...select csvMaker(last_name, eid)from webstf2group by last_name, eid
I get the following error:Server: Msg 195, Level 15, State 10, Line 17'csvMaker' is not a recognized function name.
--------------------http://www.mejoe.com/(Joe) Joseph McBride