A couple of years ago I was talking to a fellow developer, and he did something which stopped me in my tracks. He was working in management studio, and selected and modified several rows of code in one go.
Consider the following script:
SQL Sith - The Dark Side of SQL |
|
There are times throughout your career when you stumble across something that you really should have known, but didn't. Something that is mind blowing in its simplicity, but pays dividends every time you use it. A couple of years ago I was talking to a fellow developer, and he did something which stopped me in my tracks. He was working in management studio, and selected and modified several rows of code in one go. Consider the following script: Its always good practice to qualify field names with a table alias, and so I want to do this. Up until I learnt this tip I would have had to modify each field individually, but its far easier with vertical select. Whilst I have known for more years than I care to recall that by holding Shift I can select a horizontal range of text, I didn't realise that by holding Alt and Shift I could actually select a vertical range. In the below image I have selected the vertical range at the start of the field names: Anything that I type now is applied to all selected rows simultaneously: Happy SQLing!
0 Comments
|
AuthorI am a BI Consultant almost 20 years experience in the Finance, Logistics and Direct Marketing sectors. Whilst my career has centred primarily around the SQL Server stack, I firmly believe that no tool is right in all situations, and added Python to my toolkit several years ago to do the things that SQL can't. I believe in automation where practical, and specialise in the creation of metadata driven ETL frameworks. Archives
September 2020
Categories
All
|