I always forget to save the quires that I'm executing against sql server and want to recover them without writing them back, here's a handy script which I use for this
from sys.dm_exec_cached_plans p
outer apply sys.dm_exec_sql_text (p.plan_handle) sql
where [sql].[test] like '%Something goes here%'
order by usecounts desc