Strange with sys.triggers

Hi Guys

i am using follwing script to create trigger on table through ssis package  which can populate W_UPDATE_DT with getdate()  if a column in rows updated

it was fine, but now  even though the particular trigger is existing on table the package is failing with invalid object name of "TR_DIM_xxx_ON_W_UPDATE_DT"    
IF  (select  name from sys.triggers where name='TR_DIM_xxx_ON_W_UPDATE_DT')  is null
  BEGIN
 exec('create trigger TR_DIM_xxx_ON_W_UPDATE_DT         
   ON  [dbo].[xxx]
   AFTER UPDATE
AS
BEGIN
 update [dbo].[xxx]
 set [W_UPDATE_DT]=(select getdate()) where [Row_wId]=(select [Row_wId] from inserted)
and row_wid<>0
end')
end Please let me know what the devastating thing happen inside my serve
May 25th, 2015 3:28am

The question is what changed between it worked and not.

What is the exact error message?

How to reproduce your issue exactly?

Free Windows Admin Tool Kit Click here and download it now
May 25th, 2015 9:16am

Hi ADKR,

If I understand correctly, you type the query in SQLStatement property of Execute SQL Task.

Based on my test, the Execute SQL Task works perfectly. Then when there is one row of [Row_wId] column update, then the [W_UPDATE_DT] column would be updated to getdate().

If there are any misunderstanding, please elaborate the issue for further investigation.

Thanks,
Katherine Xiong

May 25th, 2015 11:05pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics