CREATE TRIGGER [Object_Change_Trigger_DDL] ON DATABASE FOR ALTER_TABLE,DROP_TABLE,CREATE_TABLE,CREATE_INDEX,ALTER_INDEX, DROP_INDEX AS DECLARE @EventData AS XML; SELECT @EventData = EVENTDATA(); IF @EventData.value('(/EVENT_INSTANCE/LoginName)[1]','varchar(150)') NOT IN ( 'uws_M_ApricotMDM_dev' ,'Us_wangdan_temp' ,'NT AUTHORITYSYSTEM' ,'NT SERVICEMSSQLSERVER' ,'WIN-6RNHUPNK4OJAdministrator' ,'NT SERVICESQLSERVERAGENT' ,'bl_un' ) BEGIN --RAISERROR ('创建,修改,删除表的权限已收回,如有问题请联系DBA!', 16, 1) ROLLBACK END GO ENABLE TRIGGER [Object_Change_Trigger_DDL] ON DATABASE GO