Page 1 of 1

Schema name is missing in the trigger script

Posted: Mon 23 Jul 2018 07:30
by Ganendran
Hi,

Schema name is missing in the ALTER trigger statement when it contains different schema name the dbo.
See below the script from dbForge and SSMS

ex. script generated bij dbForge

Code: Select all

--
-- Alter trigger [trfOutBOM] on table [EAI].[OutBOM]
--
GO
IF OBJECT_ID(N'[EAI].[trfOutBOM]', 'TR') IS NOT NULL
EXEC sp_executesql N'CREATE OR ALTER TRIGGER [trfOutBOM] ON [EAI].[OutBOM]
AFTER INSERT, DELETE
AS
BEGIN
  DECLARE @SystemTrigger BIT = 0

  IF UPDATE (DatumUpdate) AND Update(DatumCreatie) AND UPDATE (LastUser) AND UPDATE (LastHost)
     SET @SystemTrigger = 1;
  
ex. Script generated by SQL Server Management Studio

Code: Select all

ALTER TRIGGER [EAI].[trfOutBOM] ON [EAI].[OutBOM]
AFTER INSERT, DELETE
AS
BEGIN
  DECLARE @SystemTrigger BIT = 0

  IF UPDATE (DatumUpdate) AND Update(DatumCreatie) AND UPDATE (LastUser) AND UPDATE (LastHost)
     SET @SystemTrigger = 1;
 
Regards,
Ganendran

Re: Schema name is missing in the trigger script

Posted: Mon 23 Jul 2018 09:23
by alexa
We will investigate this issue and will answer you as soon as possible.