• Priya004 (9/18/2014)


    Hi,

    Need a query to compre two database schemas.

    I have seen lot of comparision tools but need a query.

    Thanks

    Do you have replication installed on a (it can be any) SQL Server?

    If you do, then installed within the SQL Binaries folder is a command-line tool called tablediff

    It's not required for your DB to have replication running to use tablediff.

    There are several commands/switches that you can use with 'tablediff' checkif it will work for you.

    It's capable of comparing data [source] [destination] that's and generate the differences.

    If Schema different you'll get an error, which help you identify it's inconsistent ..however I don't believe it will generate a script to correct that.

    From another response it mentions you cannot connect the servers to each host/server directly. I agree with Igor it's best to use a specialized compare tool to do that, but if the company you are working for is on a budget using tablediff may help.

    I've used RedGate and DB Artisan Compare tools. I can't remember if either was better - but both were better than writing T-SQL queries 🙂

    --------------------------------------------------
    ...0.05 points per day since registration... slowly crawl up to 1 pt per day hopefully 😀