Skip to content
Advertisement

SQL server 2012 SP_HELPTEXT extra lines issue

I am using SQL server 2012, & always use SP_HELPTEXT to get my previously created Stored Procedures, In previous versions of SQL server there were no issues in this process but in 2012, My Stored Procedures come with extra lines, for example this is the procedure that I wrote

Now after using SP_HELPTEXT with this procedure (or any other procedure), I am getting this output

Do any one else also facing this problem or I am the only one on this planet to struggle with this issue ?? Does any body know how to solve this issue ??

Configuration of my SQL server is as follows (copied from Help -> About )

Thanx in advance.

Advertisement

Answer

I can replicate this behaviour if I run sp_helptext with Results to grid set, then copy and paste the results from grid into a new query or any other text editor.

This seems to be a change in the behaviour of sp_helptext from previous editions, since this effect isn’t displayed with standard grid result sets.

The simplest work-around will be to run sp_helptext with Results to text set (Query -> Results to > Results to text, shortcut CTRL + T.

You may need to increase the maximum number of characters per line in Results to text to get the output you expect – Tools > Options > Query Results > Results to text – set “maximum number of characters displayed in each column” to the maximum value of 8192.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement