How to find out the particular string used by tables

Self-Innovator
Posted by Self-Innovator under Sql Server category on | Points: 40 | Views : 916
Hi,
The below code is to find out the specific records consumed by list of tables in a Database sql Server 2008.
Ex:- Search for string 'INDIA'
SELECT Tbl.NAME AS TABLE_NAME,SCHEMA_NAME(SCHEMA_ID) AS SCHEMA_NAME,Cln.NAME AS COLUMN_NAME FROM SYS.tables AS Tbl
INNER JOIN
SYS.columns as Cln ON Tbl.object_id=Cln.object_id WHERE Cln.name LIKE 'INDIA%'

Comments or Responses

Login to post response