13

In SSMS when I do a

Find and Replace in Files

(default keystroke CTRL+SHIFT+H)

Edit > Find and Replace > Replace in Files

If I set the "Look In" to "Current Document" then do a change and select the Replace All button, the Look In dropdown changes to select

All Open Documents

How can I keep Look In set to whatever I previously have selected? I want to KEEP it set to Current Document Frankly this behavior is super annoying.

Morten
  • 398
  • 1
  • 6
  • 16
Mark Schultheiss
  • 32,614
  • 12
  • 69
  • 100
  • 2
    There's no option to change that behavior - you might consider to file a feature/bug request on Microsoft Connect... Update: There is already a [bugreport](https://connect.microsoft.com/SQLServer/feedback/details/2593572/ssms-2016-rc2-find-and-replace-window-reverts-to-all-open-documents-are-replacing-all-within-the-current-document)... – Peter Schneider May 24 '17 at 16:57
  • @PeterSchneider - it SAYS in that bug report it is fixed (2016) but alas it is NOT in the current SSMS 2016 code base, hope they do a bug patch. Thanks so much for finding that though – Mark Schultheiss May 24 '17 at 19:26

2 Answers2

6

This appears to be an unresolved bug. https://connect.microsoft.com/SQLServer/feedback/details/2593572/ssms-2016-rc2-find-and-replace-window-reverts-to-all-open-documents-are-replacing-all-within-the-current-document

Attempted to submit feedback on that issue on that site but frankly the site UI and attempts to use it were horrid and would not even allow me to submit feedback or comments. Thanks Microsoft for that mess.

Found 2593572 but in

Microsoft SQL Server Management Studio 13.0.16106.4

this still exists. This site UI is pretty horrid BTW with "Please Wait...." all over then, after logging in would not even allow comments etc.

So simply closing this question per that; I might consider other tools besides SSMS as a "workaround".

EDIT: As icing on the cake attempted to submit a comment to the posted site admin email at the bottom of the pages:

Message not delivered Your message couldn't be delivered to datpconn@microsoft.com because the remote server is misconfigured. See technical details below for more information.

Mark Schultheiss
  • 32,614
  • 12
  • 69
  • 100
  • 1
    new home for this suggestion seems to be: https://feedback.azure.com/forums/908035-sql-server/suggestions/38620408-ssms-find-and-replace-look-in-values-change-with – SqlZim Jan 20 '21 at 16:58
  • 2
    @SqlZim That link is broken. I think MS cleans out Connect, UserVoice, feedback.azure, etc. etc. every few years so there's no record of all the old bugs they still haven't got to. – Reversed Engineer Jan 31 '22 at 15:54
0

A workaround for this that works for me; open another query window and leave it blank. When you do a replace it defaults to "All Open Documents" instead of "Entire Solution".