Jeff Moden wrote:
On a different note, I'm really happy that they fixed the "code wrapping" and indentation issues on this forum but, unless they limit the vertical height of the code window, that horizontal scroll bar is pretty useless and annoying at best.
It's there because of how wide the comments are in your SQL, Jeff. I'd far more prefer a horizontal scroll bar, than what was happening before; which was that if the code was too wide it was put onto multiple lines. That made for real hard reading. 🙂
To take a portion of the code from Alin above, it ended up looking like:
SET @sql = REPLACE(@sql, '##JOIN##', 'INNER JOIN dbo.Customers t2 ON t1.[CustomerID]
SET @sql = REPLACE(@sql, '##CUSTOMERCOLUMNS##', ',t2.[Name] AS [CustomerName],
t2.[Address] AS [CustomerAddress]')
SET @sql = REPLACE(@sql, '##CUSTOMERSTATE##', 'AND t2.[State] = 1 /* Only
active customers */')
(I have added the line breaks manually here).
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.