Friday, June 26, 2009

How to disable or enable SQL Server logon trigger

In my previous post we discussed process to implement logon trigger for different purposes. Later some time it may be required to skip the customizations implemented through logon trigger. So for this you may disable the logon trigger rather than to drop it.
If we want to disable the trigger [RestrictSSMSLogIn] that we created during previous post, following is T-SQL command to disable the logon trigger
DISABLE TRIGGER RestrictSSMSLogin
ON ALL SERVER
GO

You may use following T-SQL command to enable the logon trigger later at any time
ENABLE TRIGGER RestrictSSMSLogin
ON ALL SERVER
GO

0 comments:

Post a Comment

Express your views about this post