Schema name is missing in the trigger script

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
Ganendran
Posts: 14
Joined: Tue 21 Nov 2017 14:51

Schema name is missing in the trigger script

Post by Ganendran » Mon 23 Jul 2018 07:30

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

alexa

Re: Schema name is missing in the trigger script

Post by alexa » Mon 23 Jul 2018 09:23

We will investigate this issue and will answer you as soon as possible.

Post Reply