Every developer has a different habit. Some like to format the functions in upper case and some wants it in lower case. I often see developers listing the columns in SELECT clause in a different way. I have my own preference but I do respect the other developer’s preference as well. I do not advise to change anybodies habit but there is one thing which I strongly prefer to do on the client side when I am editing code.
WRAP THE CODE!
Well, it is indeed very difficult to read the code when users have to horizontally scroll the code. Now when I am working on the file originally created by another developer, I do not like to change their formatting. I have a very wide screen on my personal desktop computer but when I see the same on my 12″ laptop, I see the horizontal scrolling. There can’t be a single solution in the case of the wrapping the code, which fits all the screens.
Fortunately, there is a solution which will fit all the screens.
SQL Server Management Studio has a setting which will wrap the code displayed on the screen. Even if you resize the screen the code wraps. It will be very difficult to explain that in words – I suggest you watch following SQL in Sixty Seconds Video on this subject.
You can access the settings from SSMS >> Tools >> Options >> Text Editor >> Transact-SQL. It will show the following screen.
Let us see the same concept in this SQL in Sixty Seconds:
Related Tips in SQL in Sixty Seconds:
- Auto Recovery File Settings in SSMS – SQL in Sixty Seconds #034 – Video
- A Cool Trick – Restoring the Default SQL Server Management Studio – SSMS
- SSMS 2012 Reset Keyboard Shortcuts to Default
- Manage Help Settings – CTRL + ALT + F1
- Copy Column Headers from Resultset – SQL in Sixty Seconds #027 – Video
- SELECT TOP Shortcut in SQL Server Management Studio (SSMS)
- Color Coding SQL Server Management Studio Status Bar – SQL in Sixty Seconds #023 – Video
- Clear Drop Down List of Recent Connection From SQL Server Management Studio
What would you like to see in the next SQL in Sixty Seconds video?
Reference: Pinal Dave (http://blog.sqlauthority.com)