title: TSQL copy one database to another
body: <p>I have two identical databases lets call them A &amp; B, what I want to do is to have two copy options:</p>
  
  <p>1- Copy the whole database and overwrite everything from A to B with TSQL</p>
  
  <p>2- With TSQL I want to loop over each table row in A and check the last modified date filed if is greater then last modified date in B table row copy and overwrite the whole row.</p>
  
  <p>Please let me now if something is not clear, any help is very appreciated and thanks in advance.</p>