title: Adding character to inner join statement
body: <p>I'm working on a SQL Server database where <code>db1.dbo.batches.id</code> is stored as <code>1234</code> but <code>db2.dbo.activity.batch_id</code> is stored as <code>B1234</code>. </p>
  
  <p>I am trying to join the two tables, something like this...</p>
  
  <pre><code>SELECT column1, column2
  FROM db1.dbo.batches AS b
  INNER JOIN db2.dbo.activity AS a
  ON ('B' + b.id) = a.batch_id
  </code></pre>
  
  <p>The issue is the <code>('B' + b.id)</code>. I have tried <code>CONCAT('B' + b.id)</code>, <code>CAST('B' + b.id)</code>, and <code>CONVERT(varchar(10),'B' + b.id)</code> none of which have worked. </p>
  
  <p>I can run a second select query but I was hoping for something more elegant. </p>
  
  <p>Any ideas? Cheers!</p>