One of the things I like the most about SQLServerCentral.com is how easy is usually is to post formatted code. It's come a long way but there are still some problems with the "Pretty Print" class code block both in the forums and the article "Contribution Center". I don't know if it's possible but it would be a wonderful thing if some of these minor problems could be repaired in the near future.
1. Neither preserves the color of comments when an apostrophe is present in the comment. Instead, it reads the apostrophe as a single quote and colors everything after that Red. For example…
(--==== This is Jeff's 1st test comment
)--==== This Jeff's 2nd test comment
2. Observing the same example above, neither preserves comments when the comment is a trailing comment immediately after either a left or right parenthesis. The work around, of course, is to insert a space between the parenthesis and the first dash of the comment but most folks don't expect this.
3. Both use light gray coloring for some symbology which, at best, is difficult to read. See the NULL, parenthesis, and the mathematical operatior in the following.
SELECT ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) + 1;
Further, some of the functions also appear in light gray (Left and Right below).
4. In the "Contribution Center", by default, if a line is long enough to trigger the scroll bars, it also makes the code block window much too long. This can be (apparently) manually adjusted in the contribution center but only if the width of the window is small enough (it usually is) so that you're actually aware of the problem. This problem no longer appears on the forums.
5. During copy and paste operations from such a rendered code block, the code appears as a single line when pasted into SSMS. There was a time when this all worked perfectly and wonder if it can be brought back.
6. Occasionally, characters such as "<", ">", etc show up as their entitized value instead of being displayed correctly. (or course, it works correctly for me now... go figure).
WHERE A < B
As a sidebar, most of these problems where repaired in previous editions of the code blocks and the latest "upgrade" has resurrected these problems.
is pronounced ree-bar and is a Modenism for R
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair
How to post code problemsHow to post performance problemsForum FAQs