How to compare data between two databases using toad data point? - sql

I have access to two different data bases 1. SQL Server and 2. Sybase using toad data point.
I have the below data:
What query do I write to compare data between the two databases - given their table_name and Col_name and I only have access to Toad to connect to the databases?
I want to test whether there is same data reflecting under tables and columns for the two databases.

Related

Compare two tables with different schema in SQL Server

I have two tables in different databases with different schema, how can I compare them both?
Let's say I have the DB1 with the table history.Table1 and another DB2 with the same table but in a different schema, backup.Table1.
Now I need to compare what's different besides the schema name obviously.
Try SQL Compare from Redgate. They allow you to compare pretty much everything from the actual data to the schema.
I dont believe there is any native functionality in sqlserver.
Compare SQL Server schemas and deploy differences fast
Compare and deploy SQL Server database contents

Cross-Database Query on Azure SQL Database

I am using Azure SQL Database and I have two databases. I want to select one table data on the first database and merge into another (conditional) table of second database.
Is there any SQL solution to solve my problem?

Filling tables with data

I have created Relational Model in Oracle SQL Data Modeler with all tables and relations. I would like to generate a DDL to use it in Oracle SQL Developer and work with some SQL queries.
Before generating DDL I would like to fill all the tables with data, so I can put DDL with all data for tables prepared in it.
So, how can fill tables with data in Oracle SQL Data Modeler?
Tables can be filled with data in SQL Oracle Developer, filling it before in Data modeler is not needed.

Periodically store data from a PostgreSQL table to SQL Server 2005 table (with the same schema)

I have a PostgreSQL database that stores real-time data from sensors in a specific table (every 30sec).
What I want to do, is to get periodically the data from the remote PostgreSQL database (for instance every 30sec) and store them in SQL Server 2005 to manipulate them locally. I don't care about having the two databases with duplicate tables. Actually this is what I want to achieve!
So far, I have as Linked Server the PostgreSQL to SQL Server and I can query and retrieve the sensor data. However, I prefer to store them in my SQL Server for performance reasons.
Solution so far:
Make select openquery statements with the linked PostgreSQL and insert the results to my table in SQL Server. Repeat this periodically and store fresh data only (e.g. with a larger timestamp).
I assume that my proposed solution is not ideal. I want to know what are the best practices to achieve this synchronization between the two databases.
Thank you in advance!
If you don't want to write your own code(implementations) to do that you can use SymmetricDS to synch the table from postgreSQL to MSSQL .

How do you transfer all tables between databases using SQL Management Studio?

When I right click on the database I want to export data from, I only get to select a single table or view, rather than being able to export all of the data. Is there a way to export all of the data?
If this is not possible, could you advise on how I could do the following:
I have two databases, with the same table names, but one has more data than the other
They both have different database names (Table names are identical)
They are both on different servers
I need to get all of the additional data from the larger database, into the smaller database.
Both are MS SQL databases
Being that both are MS SQL Servers, on different hosts... why bother with CSV when you can setup a Linked Server instance so you can access one instance from the other via a SQL statement?
Make sure you have a valid user on the instance you want to retrieve data from - it must have access to the table(s)
Create the Linked Server instance
Reference the name in queries using four name syntax:
INSERT INTO db1.dbo.SmallerTable
SELECT *
FROM linked_server.db.dbo.LargerTable lt
WHERE NOT EXISTS(SELECT NULL
FROM db1.dbo.SmallerTable st
WHERE st.col = lt.col)
Replace WHERE st.col = lt.col with whatever criteria you consider to be duplicate values between the two tables.
There is also a very good tool by Redgate software that syncs data between two databases.
I've also used SQL scripter before to generate a SQL file with insert statements that you can run on the other database to insert the data.
If you right-click on the database, under the Tasks menu, you can use the Generate Scripts option to produce SQL scripts for all the tables and data. See this blog post for details. If you want to sync the second database with the first, then you're better off using something like Redgate as suggested in mpenrow's answer.