Agree on the first comment, but not on the second. Try this:
Declare @Var as varchar(1000)
set @Var = ''
Select @Var = @Var + case when len(@Var) + len(name + ', ') < 1000 then name + ', ' else '' end
from dbo.SysObjects order by name
Select @Var, len(@Var)