Launch week: the Season Pass & Fundamentals Week are 50% off — ends in 19d 15h 02mSee the sale

SSMS Trick: Edit Large Procedures with the Splitter Bar

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.)

Free, 3× a week

Get my new posts by email

Three posts a week, plus a Monday roundup of the best database news from around the web.

11 comments

  1. 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!

  2. 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.

Leave a comment

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