title: MS SQL Server 2005 Copy data from one table to another
body: <p>Hey all, I am trying to find out how to copy data from one table to another database table. I have two connections to two different databases. Ones called comp-DEV1 and the other SQLTEST. I am currently unable to copy data from my sorce table (SQLTEST) to my destination table (comp-DEV1).</p>
  
  <p>This is the error:</p>
  
  <blockquote>
    <p>Msg 102, Level 15, State 1, Line 2 Incorrect syntax near '-'.</p>
  </blockquote>
  
  <p>Query:</p>
  
  <pre><code> INSERT INTO comp-DEV1.EMSSQL.dbo.tblCL
   SELECT *
   FROM SQLTEST.EMSSQL.dbo.tblCL
   WHERE NOT EXISTS(SELECT * 
               FROM comp-DEV1.EMSSQL.dbo.tblCL 
               WHERE (SQLTEST.EMSSQL.dbo.tblCL.CID = comp-DEV1.EMSSQL.dbo.tblCL.CID)
               )
  </code></pre>
  
  <p>Any help would be great :o)</p>
  
  <p>David</p>