Sql query formatting in just one line

-4

In some cases, when we save a query .sql, even if it is indented correctly in SSMS when we open it in notepad (windows) all the text stays in a line only, joining END with GO (ENDGO) at the end of a change in procudere ( for example).

How to solve this?

    
asked by anonymous 09.01.2018 / 18:23

1 answer

0

In some cases, it may be the operating system. In Windows, enter generates a special character "CR LF" but on the MAC the enter generates only "CR". On Windows, "CR" does not work as a line break.

In notepad ++ you can check for these line breaks by searching for the regular expression "\ r [ ^ \ n] ", using this regular expression, you will find special characters" CR ".

    
09.01.2018 / 18:30