Compare two different databases - database

I have two databases, DB mysql & DB Access.
I want to compare two the same tables from this different databases about data and schema.
I need a tool for do it. Can you help me!

With DataGrip, you can select 2 databases, right-click and select Compare.

If it is only for 2 tables with identical columns, the best way would be to extract the data into and ordered csv and use a diff tool to compare the files. If you want to compare many tables and the table structure you'll need to extract each in turn.

I don't know if it the best but IBM Data Studio can do that if I'm report to this post.

You could use JetBrains IDE data grip and dump both files out and then compare using either excel or CLI

Related

Slicing and dicing data from a single table

We have a table with 20M+ records and growing in SQL Server.Our users want to access this table and slice and dice the data preferably using pivot tables.
What is the best way to go about this? We don't have any tools per se in-house except for SSAS. So thinking of create a cube off a single table and giving the users an excel linked file.
Is this a good approach? Are there any other options?
TIA,
Bee
Update:
I apologize I forgot to add that I did try giving the users a Power Pivot file - but it showed up blank when they opened it (oops!). Plus they indicated that they prefer not to use power pivots.
We also have SSAS in-house but Multi-dimensional services. I was hoping to use SSAS tabular until I read that we cannot host both Tabular & MDS in one server. Hence the question.
Thanks again.
The excel option is the only best option. You can slice and dice in pivot table easily.

Comparing output of DDLGEN from two databases

I have used the ddlgen tool to export the database schemas from my DEV and UAT servers. Now I am trying to file diff the output but the order in which the DDL is generated is different from both servers.
The documentation for the tool does not appear to have an option for sorting the output. Is there one?
Alternatively, is there another tool available for this purpose?
Regarding sorting you are right, there's no option to do it!
If you need to compare schemas, you can extract all tables and all stored procedures one at a time. Then you compare each files individually.

Script data in one table on one server and insert into the same table in another server

I have a table on my QA Environment. I want to copy the data from that table to the same table in another environment. How can I do this??
The best way would be to use a tool specifically designed for this - Red-Gate SQL Data Compare.
It costs a little bit - but it's worth every penny ! It will save you loads of grief and time - it can easily compare two existing database tables, and copy only those rows that are new (or have changed). You can work from a SQL backup file, too - excellent stuff. Check it out!
I assuming you want two table with same data. You can use SSMS Import Data function.
http://msdn.microsoft.com/en-us/library/ms140052.aspx
The easiest method is to use an SSIS package.

Run a query from two data sets programmatically

I am trying to reconcile data from a website and a database programmatically. Right now my process is manual. I download data from the website, download data from my database, and reconcile using an Excel vlookup. Within Excel, I am only reconciling 1 date for many items.
I'd like to programmatically reconcile the data for multiple dates and multiple items. The problem is that I have to download the data from the website manually. I have heard of people doing "outer joins" and "table joins" but I do not know where to begin. Is this something that I code in VBA or notepad?
Generally I do this by bulk inserting the website data into a staging table and then write select statments to join that table to my data in the database. You may need to do clean up first to be able to match the records if they are stored differently.
Python is a scripting language. http://www.python.org
There are tools to allow you to read Excel spreadsheets. For example:
http://michaelangela.wordpress.com/2008/07/06/python-excel-file-reader/
You can also use Python to talk to your database server.
http://pymssql.sourceforge.net/
http://www.oracle.com/technology/pub/articles/devlin-python-oracle.html
http://sourceforge.net/projects/pydb2/
Probably the easiest way to automate this is to save the excel files you get to disk, and use Python to read them, comparing that data with what is in your database.
This will not be a trivial project, but it is very flexible and straight forward. Trying to do it all in SQL will be, IMHO, a recipe for frustration, especially if you are new to SQL.
Alternatively:
You could also do this by using VBA to read in your excel files and generate SQL INSERT statements that are compatible with your DB schema. Then use SQL to compare them.

Combining multiple sql databases into one database

Here's my problem: I have a website that uses two different nonidentical sql server databases: one that is used to store information about the website users, the other stores information about my online retail store. But my hosting plan would only let me deploy a single database. Hence I want to combine my two databases, to form a single database.
Is there an easy way to combine the two databases into one, instead of creating every single table separately? The two databases do not share any data/columns/tables in common.
Can someone plz let me know how to get through this? I would really appreciate any help.
Thanks!
You can script the objects and import the data, ensuring that any dependencies are created in the right order.
If you need to maintain any sort of logical separation, you can also use SCHEMAs within the database (starting with SQL Server 2005) to organize them into two distinct areas - this would most likely require an application change, however.
If tables is all you want to move around, I suggest you use the Import and Export Data tool to import all the tables of database A into database B.
If you have views, SPs, etc. I suggest you generate scripts for all of them and run them scripts on the destination database once you have transferred the tables.
Use the Import Data tool to move the one database's tables and data from the second database into the first one.

Resources