title: SQL Server Convert Table Contents into Merge Statement?
body: <p>I have a table of lookup data that was changed in "location A" and I need to update the same named table in "location B". I am thinking that if I had a way to read the table (80k rows) line by line into a properly formatted string, and create an output file of/with a merge statement ("converting" the table into a CTE), then I could have something slick.</p>
  
  <p>All ideas (or pointers from those who have already done something similar) on this idea are appreciated. Thanks. I am using SQL Server Express 2012.</p>