cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

Limit generated SQL code line length to maximum allowed

According to a Stack Overflow post, the maximum line length in SQL Server Management Studio is "65536*Network Packet Size - which by default is around 1500 bytes." When recently exporting SQL scoring code through the Formula Depot in JMP Pro for a Bootstrap Forest model the code was formatted as only three lines of incredible length. SQL Server couldn't even parse the code and simply paging down in the code became a time consuming process. When copied into Word, the document was >2,000 pages long!

 

This could be avoided by either A) fully parsing the code with line breaks and indentation using common best practices or B) adding line breaks every so often into the generated code at a few logical points such as at the start of each new CASE statement with a rule to force in a break before the limit is reached.