# I wanted to find ALL references to a particular string (domain\user) and I had no idea WHERE it might be.
# so how do you ask SQL to go look everywhere and report back?
# like this...

DECLARE @searchValue varchar(100)
SET @searchValue = 'domain\username'
SELECT  'select ''' +
  table_schema +
  '.' + TABLE_NAME +
  '.' + COLUMN_NAME +
  ''' from ' + TABLE_SCHEMA + '.' + table_name +
  ' where ' + TABLE_SCHEMA + '.' + TABLE_NAME + '.' + column_Name + ' = ''' + @searchvalue + ''' union '
FROM information_schema.columns WHERE data_type in ('nvarchar','varchar' )

  1. Open SQL Management studio
  2. Open a new query window
  3. Make sure you are connected to the right database
  4. Hit Cntrl-T (we want text output)
  5. Run the query above against your database, replace @searchValue
  6. A big fat query should be in the results pane below. Copy and paste it into a new window.
  7. Strip out the last  'union' statement
  8. now the new query is ready so -  run...