• I copied and pasted this into a deummy db and it all compiled fine. Are you using SQL 2005? I If not, you'll need to change varchar(max) to something like varchar(10) or some other value large enough to hold your results. made the assumption that since you posted in the 2005 are that you were. If you're using

    DAB