A quick tip for working with large scripts in SSMS

SQL Server
7 Comments

Sometimes great things stare you in the face for years

Sometimes they stare at you for so long that you stop noticing them. This isn’t a romdramadey tag line. There are just so many buttons to push. Sometimes pressing them is a horrible idea and it breaks everything. I lose my mind every time I go to move a tab and I end up undocking a window. This won’t save you from that, but it will at least save your mouse scroll wheel.

This has helped me out a whole bunch of times, and especially, recently, when contributing code to our Blitz* line of stored procedures. Navigating all around large scripts to change variables or whatever is a horrible nuisance. Or it can be. When the stores procedure is like 3000 lines and there’s a bunch of dynamic SQL and… yeah. Anyway. Buttons!

Personality Crisis

There’s a little button in the top right corner of SSMS. Rather unassuming. Blends right in. What is it? Fast scroll? Some kind of ruin all your settings and crash your computer button? Delete all the scripts you’ve been working on for the past 6 months?

No! It’s a splitter, screen splitter! Guaranteed to blow your mind! Anytime!

This is a huge picture. Sorry.
This is a huge picture. Sorry.

If you drag it up and down, you can alter the visible portion of the screen, and scroll and zoom in each pane independently.

Now there is world peace.
Now there is world peace.

There you have it

Next time you need to work with a huge script and find yourself scrolling around like a lunatic, remember this post!

Thanks for reading!

Previous Post
[Video] Office Hours 2016/04/20 – Now With Transcriptions
Next Post
When Should You Hire a Consultant for Amazon RDS?

7 Comments. Leave new

  • Many word processors have this feature. Even WinWord… 🙂
    It’s good to have it in SSMS as well.

    Reply
  • This and bookmarks, so you can easily jump to certain places in your code.

    Reply
    • That’s awesome. It’s definitely something that isn’t obvious if you aren’t messing around with the windows. I forget about it all the time.

      My approach for editing a large file is a little different. Food for thought, link up Sublime Text 3 to directly work on the same script file. You can benefit from multi-cursor editing on overdrive, with some very sophisticated plugins. In addition, sublime text 3 can eat huge files for breakfast.

      Split personality text editing in SSMS with Sublime Text 3 Edit: http://bit.ly/26AIip9

      Now that I think about it, you could even link a custom “build system” to trigger the sql execution if needed via sqlcmd or powershell…. something I think i’m going to have to try now 🙂

      Reply
  • wow, now I just noticed this is in visual studio (2015 anyway) as well. THANKS!

    Reply
  • This is great!! I have never noticed that part of the screen, just figured it was part of the up and down scrolling. I can definitely use this! Thank you !!

    Reply
  • I had never noticed the button. Thank you!

    Reply
  • Thanks for the tip!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.