I know that in SQL Server Management Studio 2014 using Ctrl + H allows me to replace one word with another.
I have a database script (creation of tables, procedures, views, etc.) that are approximately 150000 lines of code, in this script I have added some extra comments that contain a word that I DO NOT want to remove from comments but I want to remove T-SQL code, for example:
-- Comment [SuperSec].[dbo].[tableA]
SELECT X.*
FROM [SuperSec].[dbo].[tableA] X
WHERE X.Id = '0';
I want it to look like this:
-- Comment [SuperSec].[dbo].[tableA]
SELECT X.*
FROM [dbo].[tableA] X
WHERE X.Id = '0';
Is it possible to do this using Regex or something similar?
UPDATE:
I did not say this at the beginning but this word corresponds to the name of the database, therefore it is referenced in many parts, not only in a FROM, also in a function, an EXEC of a procedure, a subquery, part of a SELECT , in many places.
Thanks :)