Function source is losing its formatting

During the Beta cycle, I identified a problem with the source code of procedures losing their formatting (tabs, spaces, and blank lines) after an ALTER statement. The problem was tracked down to the way Toad retrieves the procedure source from the sys tables. The snippet below was from me replying to the Beta team on what I had found regarding the formatting issues. The Beta was fixed in the next cycle to retrieve the procedure source from the source column, and the GA release works fine, too.

However, functions have the same problem. If I put blank lines and spaces in for readability, they are removed after an ALTER. Could someone at Dell please check to see if the editor uses the proc_defn column (incorrect) for functions’ source instead of the source column (correct)?

Snippet of email I sent to Beta development team:

Ok**.** Got it. Here’s what I found:

select proc_defn, source from sys.sysprocedure where proc_name =‘sp_executive_summary_rpt_vrp’

The proc_defn column’s data has the comments all bunched together; the source column’s data is correctly formatted. SQL Central used the source column for display; all the other tools use the proc_defn column.

Hello Larry,

The same suggestion was applied to functions as well.

Thanks.