Here’s a SQL Server Management Studio trick that comes in super handy when you’ve got long pieces of code. I almost never see anyone use this, and I think the reason is that few people know about it.

When I’m working on a stored procedure, sometimes I want to add in a new variable or a temp table. I declare ’em all at the top of the procedure, but I’m working much farther down in the proc than that.

SSMS Need to add a temp table!

If I scroll up to add the temp table at the top, I have to find my way back here. And I’m *lazy*.

I don’t have to lose my place. I can split the window using a cool, but hard to see feature known as the “splitter bar”.

Finding the splitter bar icon in SSMS

This tiny icon is the “splitter bar”

Drag the splitter bar down. I now have two synchronized views into my procedure.

Dragging down the splitter bar

Dragging down the splitter bar opens up two work “zones” in the same document.

Voila, I can add my temp table in the right area without losing my place.

Editing two zones in SSMS

A great reason to justify that huge monitor you need for productivity.

This feature isn’t specific to SQL Server Management Studio– it exists in lots of other products. (Including Word!) But the feature is hard to spot and most folks just never seem to learn about it. (I had no idea it was there myself until Jeremiah showed it to me a while back, and now I’m addicted to it.)

Kendra Little
My goal is for you to understand your SQL Server’s behavior– and learn how to change it. When I’m not figuring out the solutions to your database problems, you’ll find me at user group meetings in Portland, Oregon. I also love to draw.
Kendra Little on sabtwitterKendra Little on sablinkedin
↑ Back to top
  1. Nice! Just used this today after reading your post. Perfect for those sprawling sprocs.

  2. That is going to come in very handy. Thanks, Kendra.

  3. Nice little trick Kendra.
    I always used CTRL+K, CTRL+K to set a bookmark and return to it with CTRL+K, CTRL+N. You can make multiple in a document and loop through it. Depends on how many parts you need to go back and forth I guess. But the split screen is certainly easy, thanks for sharing!

  4. Great little productivity tip, more please! Used to use it in Excel before getting into SQL.

  5. Pingback: (SFTW) SQL Server Links 17/01/14 • John Sansom

  6. Office 2013 has moved the splitter bar to the Ribbon. View, Split.

  7. Thank you and very nice. I have been so busy and have not been looking into the cool features that can same me time.

  8. Yes, I also know this, its similar to MS Word splitter.
    I used use this small utility in MS Word long back (since) in early 2000s.

  9. A great feature that I use often – also available in SSMS by clicking Window > Split.

  10. Thanks to this blog post i went exploring in VS 2012 as well and its there as well, Same location. Also in SSMS 2008 its in the same location but with out the arrows.

    Thanks for the tip as i used it earlier today.

  11. Loving it… Thank you ever so much for saving my life.

Leave a Reply

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