无法在 {table} 上禁用触发器,因为目标不在当前数据库中

Cannot disable trigger on {table} as the target is not in the current database

我试图禁用 SQL 服务器 table 上的所有触发器以删除一些行,然后想重新启用触发器。

但是禁用触发器命令导致错误。

命令:

DISABLE TRIGGER ALL ON [PTS].[dbo].[cadResources]

错误

Cannot disable trigger on 'PTS.dbo.cadResources' as the target is not in the current database.

你应该做

USE [PTS]
DISABLE TRIGGER ALL ON [dbo].[cadResources]