Friday, 28 October 2016

Cool SSMS trick you've probably never heard of! (Quick Tip)

Here's something you may never have tried before: ever wanted to indent multiple lines with spaces rather than tabs at the same time in SQL Server Management Studio (SSMS)? Now you can:

Here's how:

--Copy this to SSMS, hold Alt, click and drag your pointer *FROM HERE  then start typing
--Copy this to SSMS, hold Alt, click and drag your pointer             then start typing
--Copy this to SSMS, hold Alt, click and drag your pointer             then start typing
--Copy this to SSMS, hold Alt, click and drag your pointer             then start typing
--Copy this to SSMS, hold Alt, click and drag your pointer             then start typing
--Copy this to SSMS, hold Alt, click and drag your pointer             then start typing
--Copy this to SSMS, hold Alt, click and drag your pointer             then start typing
--Copy this to SSMS, hold Alt, click and drag your pointer    TO HERE* then start typing

--   ||  Now hold alt, click and drag a line between the two pipes and press space
--   ||  Now hold alt, click and drag a line between the two pipes and press space
--   ||  Now hold alt, click and drag a line between the two pipes and press space
--   ||  Now hold alt, click and drag a line between the two pipes and press space
--   ||  Now hold alt, click and drag a line between the two pipes and press space
--   ||  Now hold alt, click and drag a line between the two pipes and press space
--   ||  Now hold alt, click and drag a line between the two pipes and press space

--Cool, huh? I learnt this one from Itzik Ben Gan, SQL Master. Also, if you want to copy and paste in blocks, you can do the same. Try holding alt and not holding alt when you place your cursor (it does different things).

No comments:

Post a Comment