Edit Multiple Rows in SQL Server

When working in SQL Server Management Studio (SSMS), editing multiple lines of code manually can get tedious — especially when making similar changes to multiple rows. Luckily, SSMS supports multi-line editing, and there’s a simple shortcut that can save you tons of time:

👉 Shift + Alt + Down Arrow

This powerful shortcut allows you to edit or insert text across multiple lines at once, just like column mode editing in other editors.


✅ When to Use This Shortcut

Let’s say you’re writing multiple UPDATE statements or duplicating similar code blocks like this:

Now you realize you want to change the table name from Employees to Contractors in all lines.

Instead of editing each line individually, just:


🛠️ How to Use Shift + Alt + Down Arrow in SSMS

  1. Place your cursor right before the word Employees (or after) in the first line.
  2. Hold down Shift + Alt, then press the Down Arrow key to extend a vertical cursor across the lines you want to edit.
  3. Type Contractors (or whatever change you want).
  4. The change will be applied to all lines simultaneously.

You can also use Backspace or Delete to remove repeated content across multiple lines — perfect for batch editing SQL scripts.


🎯 Bonus: Works for Insert, Delete, and Commenting Too

This technique isn’t limited to just UPDATE statements. You can use multi-line editing for:

  • Inserting column aliases
  • Deleting repeated prefixes
  • Commenting out multiple lines (--)
  • Editing INSERT, SELECT, or DELETE blocks

🧠 Final Thoughts

Shift + Alt + Down Arrow in SSMS is a simple but powerful shortcut that can boost your SQL productivity. Whether you’re refactoring scripts or batch editing values, this technique will help you work faster and cleaner.

💻 Try it out in your next SQL session — you might never go back to single-line editing again!

Leave a Reply

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