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.
12,708 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 101K 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.