
select * from sys.plan_guides
GO

-- clean up the existing plan guides
declare c cursor
 for select name from sys.plan_guides
declare @n nvarchar(256)

open c
fetch next from c into @n
while @@fetch_status = 0
  begin
    print 'dropping ' + convert(varchar(512),@n)
    execute sp_control_plan_guide N'DROP', @n
    fetch next from c into @n
  end

close c
deallocate c


