There are two ways to delete triggers in sql: 1. Use SSMS database management tool to delete triggers; 2. Use [T-SQL] script to delete triggers, the code is [drop trigger trigger name;].
There are two ways to delete triggers in sql:
1. Delete using SSMS database management tools Trigger
Delete DML trigger
1. Connect to the database, select the database, select the data table-》Expand Data table-"Expand trigger-"Right click-"Select delete.
#2. In the delete object pop-up box - "Click OK -" you can see the deletion result without refreshing.
Delete DDL trigger
1. Connect to the database and select the database-》Expand Programmability -> Expand database triggers -> Right-click -> Select delete.
#2. In the delete object pop-up box - "Click OK -" you can see the deletion result without refreshing.
Delete LOGON trigger
1. Connect to the database-》Expand the server object- 》Expand the trigger-》Right-click-》Select Delete.
#2. In the delete object pop-up box - "Click OK -" you can see the deletion result without refreshing.
##2. Use T-SQL script to delete triggers
Syntax :
--Declare database referenceuse 数据库; go
if exists(select * from sys.triggers where name=触发器名)
drop trigger 触发器名;
--drop trigger 触发器名 on database;
--drop trigger 触发器名 on all server; go
use testss; go
if exists(select * from sys.triggers where name='updatetri') drop trigger updatetri; go
The above is the detailed content of What are the methods to delete triggers in sql. For more information, please follow other related articles on the PHP Chinese website!