Searching an entire database for a Guid or Unique Identifier
Searching an entire database for a Guid or Unique Identifier can be a bit of a tricky proposition. However a little bit of using T-SQL to generate T-SQL and viola DECLARE @GUIDHunted nvarchar(60) SET @GUIDHunted = ‘0A24EC0C-65EE-4519-89DF-ABD3DD24F7EF’ SELECT *, ‘UNION ALL SELECT '’' + s.name + ‘.’ + ao.name + ‘'’, count(*) FROM ' + s.name +'.[' + ao.name + ‘] WHERE ' + ac.name + ' = '’' + @GuidHunted + ''''