在SQL Server中,可以使用以下方法來創建、刪除、修改和查看觸發器:
CREATE TRIGGER trigger_name
ON table_name
AFTER INSERT, UPDATE, DELETE
AS
BEGIN
-- 觸發器邏輯代碼
END;
DROP TRIGGER trigger_name ON table_name;
ALTER TRIGGER trigger_name
ON table_name
AFTER INSERT, UPDATE, DELETE
AS
BEGIN
-- 修改后的觸發器邏輯代碼
END;
SELECT name, type, type_desc, create_date
FROM sys.triggers
WHERE parent_id = OBJECT_ID('table_name');
需要注意的是,在創建、刪除、修改和查看觸發器時,需要有相應的權限。