I have an urgent situation
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
/****** 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
now I cannot logon to database can I delete all triggers on sql ? is there any way to solve this problem.
If I’m understanding your question correctly, you are unable to logon due to a bug in the LOGON trigger you have created.
You can delete (DROP) the trigger under a Dedicated Administrator Connection (DAC).
Using a Dedicated Administrator Connection
How to: Use the Dedicated Administrator Connection with SQL Server Management Studio