The select scripts below can be used to find some of the places the attribute is used. First, find the attribute category's system record ID (GUID), which will be used to find references to it in various tables. The examples below demonstrate how to find an attribute with the system record ID of e1dd9c71-bcca-4e58-b824-2ede7c43f145

1) To find ad-hoc queries using the attribute:
select * from adhocquery where cast(querydefinitionxml as nVarchar(Max)) like '%ATTRIBUTEe1dd9c71bcca4e58b8242ede7c43f145%' 

2) To find export definitions using the attribute:
where CAST(EXPORTDEFINITIONXML as nvarchar(max)) like '%ATTRIBUTEe1dd9c71bcca4e58b8242ede7c43f145%'; 

3) The select statement below will search for queries with the attribute and will reference the IDSETREGISTER table to pull the dynamic selections that were created from those ad-hoc queries:
select A.NAME as [Query name],I.NAME as [IDSETREGISTER NAME], R.ID as [IDSetregisteradhocquery ID]
from dbo.adhocquery A
left Join idsetregisteradhocquery R on R.ADHOCQUERYID=A.ID
left join idsetregister I on I.ID=R.IDSETREGISTERID
where CAST(querydefinitionxml as nvarchar(max)) like '%ATTRIBUTEe1dd9c71bcca4e58b8242ede7c43f145%';