Um, but if you are running Sql Server 2005, can't you just query sys.sql_modules and return the entire definition as a NVARCHAR(MAX) field? no need to concat or anything.
Bryan