Management Studio Find and Replace

Some pretty cool stuff…

Did you know that SQL Server Management Studio makes a nice little regular expression (regex) editor and tester?  Go to find and replace (Ctrl-H) and down at the bottom of the dialog box is a check box names “Use”.  Check that box and choose Regular Expression.  Now to the right of the box where you type the text, there is a glyph that will fly out a regular expression character helper.  You can type in text in Management Studio and test a regular expression against it.

You can also leverage this regular expression functionality to do a multi-line find and replace.  You can substitute in the old C# (C++) syntax \n for a new line.  I needed to replace a block of text with a multi-line block of text and this worked beautifully!

Don’t forget you can use Management Studio to search in files too.  A nice GREP tool too!  Hit the glyph just to the right of Quick Replace or Quick Find at the top and you’ll get the option to search in files.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: