title: T-SQL INSERT INTO with LEFT JOIN
body: <p>Sorry this is a syntax question, but in T-SQL how do I specify in INSERT statement in which DB I want to INSERT and in LEFT JOIN from which DB I want to join?</p>
  
  <pre><code>if not exists (select * from [DB_A].[dbo.a_test])
  create table [DB_A].[dbo.a_test] (
  a int(10) ,
  b int(10) ,
  c varchar(200) ,
  d varchar(200) ,
  e varchar(200) ,            
  PRIMARY KEY (a)
  )
  
  
  INSERT INTO [DB_A].[dbo.a_test] (a,b,c, d)
  VALUES dbo.products.product_info, dbo.products.product_date, dbo.products.smth, *dbo.program.program_name*, dbo.program.program_smth
  FROM [DB_B].dbo.products    
  LEFT JOIN [DB_B].dbo.program
  ON dbo.program.program_name = dbo.products.product_info
  </code></pre>
  
  <p>Sorry for such a noob question, but I could not find a suitable example.</p>