Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Auto generating UPDATE queries for identical tables

$
0
0

Hi

I need to generate UPDATE queries to update identical tables between two databases. So I need statements like below generated given a list of tables;

UPDATE Table1
SET Fld1 = a.Fld1, Fld2 = a.Fld2, ... Fldn = a.Fldn
FROM Table1 INNER JOIN Table2 AS a ON Table1.id = a.id

I have a number of such identical pairs to update. Is there a way to auto generate such update queries?

Thanks

Regards



Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>