title: sql trigger insert between two databases
body: <p>I have two database DB_OLD and DB_NEW and DB_OLD has a table like Documents. our bureau program saves information into Document table. I copy all information of Documents to DB_NEW's Documents2 table. I Want; The Officcers saves an information into DB_OLD'S Documents table, automatically the same record will save into DB_NEW's Documents2 table. For this situatin a wrote a trigger like this;</p>
  
  <pre><code>    USE [DB_OLD]
  GO
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  CREATE TRIGGER SameRecord ON Documents AFTER INSERT
  AS
  BEGIN
  IF @@rowcount = 0 RETURN;
  INSERT INTO DB_NEW.[DBO].Documents2(x,y,z) SELECT x,y,z FROM INSERTED
  END;
  </code></pre>
  
  <p>But when executing the trigger officers records dont have been saved even DB_OLD's Documents table also DB_NEW's Documents2 table. whats worng?</p>