how to exclude commented line text in finding procedure with text in sql server

Michael Mikhail 0 Reputation points
2023-03-15T15:15:36.1766667+00:00

I'm trying to find all hard code in SPs and Functions in database that containg all possibilities from below:

Application = 1
Application =1
Application= 1
Application=1

can I search for that but without results from commented lines ?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,494 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 120.2K Reputation points MVP
    2023-03-15T23:25:27.65+00:00

    That is not a trivial operation, as the code has to be parsed.

    As it happens, I have a tool to do read source code strip of the comments, write it back to the database, and then bulid a full-text index on the comment-less code. But the tool is part of a larger toolset, so you may find it hard to get started.

    The toolset is AbaPerls, which you find here: https://www.sommarskog.se/AbaPerls/index.html. The specific tool I described above is VCDBLOAD, which you can use without understanding the rest of the toolset. But it may still take some time to get started.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.