T-SQL - Is there a (free) way to compare data in two tables?

Posted by RPM1984 on Stack Overflow See other posts from Stack Overflow or by RPM1984
Published on 2010-06-10T07:45:25Z Indexed on 2010/06/10 7:53 UTC
Read the original article Hit count: 185

Filed under:
|
|
|
|

Okay so i have table a and table b. (SQL Server 2008)

Both tables have the exact same schema.

For the purposes of this question, consider table a = my local dev table, table b = the live table.

I need to create a SQL script (containing UPDATE/DELETE/INSERT statements) that will update table b to be the same as table a. This script will then be deployed to the live database.

Any free tools out there that can do this, or better yet a way i can do it myself?

I'm thinking i probably need to do some type of a join on all the fields in the tables, then generate dynamic sql based on that.

Anyone have any ideas?

© Stack Overflow or respective owner

Related posts about sql

Related posts about tsql