I was testing a logon trigger to restrict connections to certain IPs. It looks like the trigger was not correct. Now I can't log in to the server even as SA
.
Is there a way to fix this?
sql servertrigger
I was testing a logon trigger to restrict connections to certain IPs. It looks like the trigger was not correct. Now I can't log in to the server even as SA
.
Is there a way to fix this?
Best Answer
You can connect to the instance using the Dedicated Administrator Connection (DAC). It only accepts local connection by default.
Sqlcmd can be used:
SQL Server Management Studio can also be used:
However trying to establish a connection from
Object Explorer
usingConnect to Server
in SSMS will fail with this message:From a disconnected Query Editor or connected with a regular user, reconnect using either of:
Once connected, DISABLE TRIGGER can then be executed: