Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Strange with sys.triggers

$
0
0

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 server


ADKR


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>