Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
reading01
Starting Member
2 Posts |
Posted - 2009-07-27 : 15:45:53
|
Hello,Ran the below script against my server. Now I can not log back into SQL management studio. I tried logging in with admin: but no luck. Does anyone know how I can drop all triggers the below script put in place?/* Create Audit Database */CREATE DATABASE AuditDbGOUSE AuditDbGO/* Create Audit Table */CREATE TABLE ServerLogonHistory(SystemUser VARCHAR(512),DBUser VARCHAR(512),SPID INT,LogonTime DATETIME)GO/* Create Logon Trigger */CREATE TRIGGER Tr_ServerLogonON ALL SERVER FOR LOGONASBEGININSERT INTO AuditDb.dbo.ServerLogonHistorySELECT SYSTEM_USER,USER,@@SPID,GETDATE()ENDGO/* Dropping Database AuditDB *//* Please note login to Server again willProduce Errors */USE masterGODROP DATABASE AuditDBGO |
|
afernandez
Starting Member
1 Post |
Posted - 2009-07-27 : 17:10:54
|
Try the following:Connect to SQL using the DAC via sqlcmd (make sure SQL Browser is started)SQLCMD.exe -S<instance_name> -Aonce logged on, issue the following statement:drop trigger tr_serverlogon on all server;goThat *should* do it. I just tested it on my workstation. |
 |
|
TimBenninghoff
Starting Member
1 Post |
Posted - 2009-07-27 : 18:14:51
|
I had the same experience with admin: via SSMS. I was able to get in to my server to disable the trigger by using sqlcmd -A while I was RDP'd to the server. I had to remote into the server because I leave remote DAC disabled. |
 |
|
|
|
|