Skip to content
Advertisement

SQL Server how to find specific data across entire database

I have this script which finds all tables that contain data in column RGNCODE. I’m trying to amend this to find tables that contain a specific value for rgncode across all tables. So RGNCODE = 'UK'. Unsure where to add this in?

Advertisement

Answer

A dynamic statement, using system catalog views, is an option here:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement