title: cannot login to sql server due logon trigger
body: <p>I have an urgent situation </p>
  
  <p>I write a logon trigger for disable to login from hacking programs but it blocked me to and none of the users cannot logon database my trigger is </p>
  
  <pre><code>  /****** Object:  DdlTrigger [connection_limit_trigger]    Script Date: 08/13/2011 08:43:04 ******/
  SET ANSI_NULLS ON
  GO
  
  SET QUOTED_IDENTIFIER ON
  GO
  
  
  ALTER TRIGGER [connection_limit_trigger]
  ON ALL SERVER 
  FOR LOGON
  AS
  BEGIN
  
     IF EXISTS (SELECT    row_count,* FROM sys.dm_exec_sessions  
     WHERE  1 = 1
          AND (program_name NOT IN ('myappname', 'Microsoft Office 2003','Microsoft Office 2007','Report Server','Microsoft SQL Server' ))        
          AND (program_name NOT LIKE '%Microsoft SQL Server Management Studio%') 
          OR host_name is not null
  
  
      )
      BEGIN
         ROLLBACK;
      END;
  END;
  
  
  --DROP TRIGGER connection_limit_trigger ON ALL SERVER
  
  GO
  
  SET ANSI_NULLS OFF
  GO
  
  SET QUOTED_IDENTIFIER OFF
  GO
  
  ENABLE TRIGGER [connection_limit_trigger] ON ALL SERVER
  GO
  </code></pre>
  
  <p>now I cannot logon to database can I delete all triggers on sql ? is there any way to solve this problem.</p>