I am using Red-Gate Data Compare to synchronize two databases, lets call them DBSource and DBDestination. DBDestination has a table, TableA which has a field which has a
not null
constraint. TableA within DBSource has the same structure, apart from this new field.When I synchronize using the Data Compare tool, it fails due to this particular
not null
field, since there's no object map I can set up for it.I wanted to know if there is a way of setting a default on the tool, since I can't alter the schema of the destination table and the file is quite large to edit?
christiandevchristiandev
1 Answer
The best way to handle this is to alter the column in the database and put a default value on it. There isn't anything you can do in the SQL Data Compare settings to make it replace illegal NULL data with a default value.
WonkoWonko
Not the answer you're looking for? Browse other questions tagged redgatered-gate-data-compare or ask your own question.
I am using Red-Gate Data Compare to synchronize two databases, lets call them DBSource and DBDestination. DBDestination has a table, TableA which has a field which has a
not null
constraint. TableA within DBSource has the same structure, apart from this new field.When I synchronize using the Data Compare tool, it fails due to this particular
not null
field, since there's no object map I can set up for it.I wanted to know if there is a way of setting a default on the tool, since I can't alter the schema of the destination table and the file is quite large to edit?
christiandevchristiandev
1 Answer
The best way to handle this is to alter the column in the database and put a default value on it. There isn't anything you can do in the SQL Data Compare settings to make it replace illegal NULL data with a default value.
WonkoWonko
Not the answer you're looking for? Browse other questions tagged redgatered-gate-data-compare or ask your own question.
Using Redgate SQL Data Compare 9.
This is a simplified example of what I want to do. I have the following tables:
Id columns in both tables are primary keys and auto-increment (identity). Product has a unique constraint on ProductName. I have a production system and a test system, and would like to use Data Compare to sync the ProductDetail tables of the two systems.
The problem is that the two systems' id columns are not synchronized. A product called 'Bananas' could have an Id of 1000 in production and an Id of 6 in test.
What I would like to do is compare using a join--so instead of using a key made up of only columns in the ProductDetail table, I could compare based on a combination of fields using both the Product and ProductDetail tables.
I don't see any way of having more than one table participate in a comparison in the Data Compare UI. Is what I'm trying to achieve possible?
Phil SandlerPhil Sandler
1 Answer
using a query with the desired join condition, create a table with the results on each db and use rg to compare those tables
mikegmikeg
Not the answer you're looking for? Browse other questions tagged sql-serverredgate or ask your own question.
Possible Duplicate:
Free Tool to compare Sql Server tables Garena pc download.
Free Tool to compare Sql Server tables Garena pc download.
I would like to compare two SQL Server databases including schema (table structure) and data in tables too. What is best tool to do this?
Community♦
Tomasz SmykowskiTomasz Smykowski
marked as duplicate by John Palmer, stusmith, Praveen Kumar Purushothaman, C.Evenhuis, user13673Nov 29 '12 at 0:55
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
15 Answers
I am using Red-Gate's software: http://www.red-gate.com
Joakim BackmanJoakim Backman
I use schema and data comparison functionality built into the latest version Microsoft Visual Studio 2015 Community Edition (Free) or Professional / Premium / Ultimate edition. Works like a charm!
Red-Gate's SQL data comparison tool is my second alternative:
(source: spaanjaars.com)
Konstantin TarkusKonstantin Tarkus
I like Open DBDiff.Updated Open DBDiff Link
It's not the most complete tool, but it works great and it's free. And it's very easy to use.
Mauro
SQL Admin Studio from http://www.simego.com/Products/SQL-Admin-Studio is now free, lets you manage your SQL Database, SQL Compare and Synchronise, Data Compare and Synchronise and much more. Also supports SQL Azure and some MySQL Support too.
[UPDATE: Yes I am the Author of the above program, as it's now Free I just wanted to Share it with the community]
Sean CleaverSean Cleaver
I'm partial to AdeptSQL. It's clean and intuitive and it DOESN'T have the one feature that scares the hell out of me on a lot of similar programs. One giant button that it you push it will automatically synchronize EVERYTHING without so much as a by-your-leave. If you want to sync the changes you have to do it yourself and I like that.
Christopher KleinChristopher Klein
There is one tool with source code available at http://www.codeproject.com/Articles/205011/SQL-Server-Database-Comparison-Tool
That should give flexibility as code is available.
Milind ThakkarMilind Thakkar
dbghost is the best i have used to date. one of the best features i have seen is that it will generate SQL code to go between versions of a database based on the SQL you keep in source control, as well as a database. simple and easy to use.
BluephlameBluephlame
I've used SQL Delta before (http://www.sqldelta.com/), it's really good. Not free however, not sure how prices compare to Red-Gates
JonoWJonoW
Try DBComparer, it's free and fast:
Red Gate Sql Data Compare
MeladMelad
Database Workbench can made it too
Cross database development
Use the Schema Compare and Migration Tools to compare testing and deployed databases, migrate existing databases to different database systems.
you can also made it with database Comparer
I use it for Firebird and it works well.
Hugues Van LandeghemHugues Van Landeghem
Try dbForge Data Compare for SQL Server. It can compare and sync any databases, even very large ones. Quick, easy, always delivers a correct result.Try it on your database and comment upon the product.
We can recommend you a reliable SQL comparison tool that offer 3 time’s faster comparison and synchronization of table data in your SQL Server databases. It's dbForge Data Compare for SQL Server and dbForge Schema Compare for SQL Server
Main advantages:
- Speedier comparison and synchronization of large databases
- Support of native SQL Server backups
- Custom mapping of tables, columns, and schemas
- Multiple options to tune your comparison and synchronization
- Generating comparison and synchronization reports
Jpg to pdf converter online free high quality. Plus free 30-day trial and risk-free purchase with 30-day money back guarantee.
DevartDevart
Sql Studio Data Compare
We are using an inhouse developed solution that is basicly a procedure with arguments of what you want included in the comparision (SP's, Full SP code, table structure, defaults, indices, triggers. etc)
Depending on your needs and budget, it might be a good way to go for you as well.
It is quite easily developed as well, then we just redirect output of procedure to textfiles and do text comparisions between the files.
One good thing about it is that its possible to save the output in source control.
/B
BrimstedtBrimstedt
I've used Red Gate's tools and they are superb.However, if you can't spend any money you could try Open DBDiff to compare schemas.
Santiago CepasSantiago Cepas
I would definitely go with AdeptSQL if you're using MSSQL. It's the least good looking but the most talented db compare tool amongst the ones I've tried. Dil chura liya mp3. It can compare both the structure and the data. It tells you which tables exist on one db but does not exist on the other, compares the structure and data of the common ones and it can produce the script to synchronize the two. It's not free but has a 30 day trial (as far as I can remember)
aslisabanciaslisabanci
I tried OpenDiff Tool . Great tool that is free and easy to use .
Senthil Kumar BSenthil Kumar B