0

I am no expert at SQL. In my first job working with this.

I have this code:

SELECT c.name AS 'ColumnName',
t.name AS 'TableName'
FROM sys.columns c
Join sys.tables t ON c.object_id = t.object_id
WHERE UPPER(c.name) LIKE '%Name of Column%' AND UPPER(t.name) like '%Name of Database%'

This is great for finding columns and what tables they live in but I need something similar to tell me what table or column a particular string lives in.

I need to find if a particular value exists within this database and if so which table it lives in.

I can do joins etc. I really just need to know how to join the data field requirement. For example, I have sys.table for system table, sys.column for column, how do I refer to the string I am looking for or the data field?

Many thanks.

Vern
  • 3
  • 2

0 Answers0