title: How to insert data from one server table to another server table using a trigger on first server table
body: <p>I need to directly insert the data from one server table to another server table with an after insert trigger on server 1 table. I have used the following code to do the work. Tables on both the servers have identical columns, table name and schema.</p>
  <pre class="lang-sql prettyprint-override"><code>CREATE TRIGGER trigger_name ON [server1].db.schema.table1
  FOR INSERT 
  AS
  
  INSERT INTO [server_2].db2.[schema].[table1](
  PLANTID
  ,PLANTNAME
  ,PLANTLOCATION
  ,COMPANYNAME
  ,DISPLAY_STATUS
  ,VERSION
  ,DEPARTMENT
  ,PURPOSE
  ,PERFORMEDBY
  )
  
  SELECT 
  PLANTID
  ,PLANTNAME
  ,PLANTLOCATION
  ,COMPANYNAME
  ,DISPLAY_STATUS
  ,VERSION
  ,DEPARTMENT
  ,PURPOSE
  ,PERFORMEDBY
  FROM INSERTED
  order by plmstrauid
  </code></pre>
  <p>However, I get the following error. Can anyone please help me with this?</p>
  <p>Error:</p>
  <blockquote>
  <p>The object name '[server1].db.schema.table1' contains more than the
  maximum number of prefixes. The maximum is 2.</p>
  </blockquote>