SQL Text Searches
How to search through Stored Procedure for a specific String
Having to find all Stored Procedures that are using a specific piece of ccode that is buggy ?
|
|
Reference : Microsoft SQL Server Doc sys.sql_modules
(‼️ Caution) How to search through all tables of a Database for a specific value
*Don’t use in a Production environment !! ** This block of code will parse the whole Database and will have an impact on the server.
Sometimes it is usefull to find where a piece of information is stored. This piece of code can help retrieving a string through all the tables of a Database, but it will check all columns, all rows and all tables.
In the sample below, we ae looking for a string “15fb658c-4520-4a66-acff-5d6e0f6eed47”
|
|
Initially posted on DBA Services
How to find the biggest tables
|
|
Initially posted on Microsoft Q&A