There is broken functionality when using Find (CTRL+F) or Find & Replace (CTRL+H) in .sql files opened via SQL Server Object Explorer. It appears to work correctly when used against .cs files. When using Find, the text is highlighted in the editor window as if the text was found but when the ENTER button is pressed, the results are always “The following specified text was not found”. Attempts with various different settings (Match Case, Match Whole Word, etc.) does not change the erroneous outcome.

I launched VS in safe mode and opened a SQL file from the local drive. The find functionality works correctly so it appears that it is not a Visual Studio issue but an extension / tool one. I opened an instance of VS with all tools / extensions active and tried an experiment with multiple SQL files. I opened (CTRL+O) one file from the local drive and another from the SQL Server Object Explorer. As indicated, both files are .sql, the only difference is how they were opened and where they reside. I attempted a search using Find (CTRL+F) and selected the “All Open Documents” option. I searched for a text string that was in all of the documents. The strings located in the local file were found. The strings located in the file opened via the SQL Server Object Explorer were not. It would appear that the issue is related to the Explorer, which I believe is part of the Microsoft SQL Server Data Tools. I am using:
Microsoft Visual Studio Enterprise 2019
Version 16.10.2
VisualStudio.16.Release/16.10.2+31410.357
Microsoft .NET Framework
Version 4.8.03761
Installed Version: Enterprise
ADL Tools Service Provider 1.0
This package contains services used by Data Lake tools
ASA Service Provider 1.0
ASP.NET and Web Tools 2019 16.10.526.50910
ASP.NET and Web Tools 2019
ASP.NET Web Frameworks and Tools 2019 16.10.526.50910
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 16.10.526.50910
Azure App Service Tools v3.0.0
Azure Data Lake Node 1.0
This package contains the Data Lake integration nodes for Server Explorer.
Azure Data Lake Tools for Visual Studio 2.6.1000.0
Microsoft Azure Data Lake Tools for Visual Studio
Azure Stream Analytics Tools for Visual Studio 2.6.1000.0
Microsoft Azure Stream Analytics Tools for Visual Studio
C# Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Microsoft Azure HDInsight Azure Node 2.6.1000.0
HDInsight Node under Azure Node
Microsoft Azure Hive Query Language Service 2.6.1000.0
Language service for Hive query
Microsoft Azure Stream Analytics Language Service 2.6.1000.0
Language service for Azure Stream Analytics
Microsoft Azure Stream Analytics Node 1.0
Azure Stream Analytics Node under Azure Node
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.40423.1
Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 2.1.113+g422d40002e.RR
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual Studio Process Editor 1.0
Process Editor for Microsoft Visual Studio Team Foundation Server
Microsoft Visual Studio Tools for Containers 1.2
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
NuGet Package Manager 5.10.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
Razor (ASP.NET Core) 16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725
Provides languages services for ASP.NET Core Razor.
Redgate SQL Change Automation 4.3.21147.25898
Extend DevOps processes to your SQL Server databases and safely automate database deployments.
Visit https://www.red-gate.com/sca/productpage for more information.
Copyright (C) Red Gate Software Ltd 2011-2021. All rights reserved.
This software contains components from Component Owl.
SQL Server is a registered trademark of Microsoft Corporation.
Visual Studio is a registered trademark of Microsoft Corporation.
SQL Change Automation contains code from the following open source software:
NuGet https://www.nuget.org/
SQL LocalDB Wrapper https://github.com/martincostello/sqllocaldb
Autofac https://autofac.org/
Json.NET https://json.net/
SemVer https://github.com/maxhauser/semver
Serilog https://serilog.net/
StringTemplate https://github.com/antlr/stringtemplate4
Extended WPF Toolkit https://wpftoolkit.codeplex.com/
Code InfoBox VSX http://www.codeproject.com/Articles/55196/Code-InfoBox-Visual-Studio-Extension-VSX
OctoPack https://github.com/OctopusDeploy/OctoPack
SQLite https://sqlite.org/
This product contains icons from http://www.visualpharm.com distributed under a free backlink license.
For license details or other notices relating to the above software, please see NOTICE.TXT and EULA.rtf in the SQL Change Automation application folder.
Redgate SQL Prompt 10.3.7.15732
Write, format, and refactor SQL effortlessly
Redgate SQL Search 3.5.5.2703
Search functionality for SQL Server databases, from within Visual Studio
SQL Server Data Tools 16.0.62105.04180
Microsoft SQL Server Data Tools
SQL Server Integration Services 15.0.2000.166
Microsoft SQL Server Integration Services Designer
Version 15.0.2000.166
ToolWindowHostedEditor 1.0
Hosting json editor into a tool window
TypeScript Tools 16.0.30429.2002
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Container Tools Extensions 1.0
View, manage, and diagnose containers within Visual Studio.
Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers
Microsoft SQL Server Data Tools

