Query from DB Azure to Local Database - azure-sql-database

I have this situation.
I have 2 BD , one DB in Azure with Name: TEST1 and another in my computer with name Test2.
I want to execute querys in BD Test1 to consult information in DB Test2.
How can i do this?
Regards.
Thanks!

SQL Azure does not support linked servers. (SQL Azure Managed Instance does for SQL-SQL connections, FWIW).
Absent that, your options are:
* run SQL Server on your local machine and run the query from there to join (using a linked server to talk to SQL Azure's db)
* run SQL Server in a VM in azure to do linked servers there against your two databases.
SQL Server 2019 CTPs do contain an external table feature that is able to talk to ODBC sources like SQL Server/SQL Azure, but that's not materially any different than the two options I suggested for you here. (It's a bit more involved to do this path and it's not supported for production workloads at this time since it's pre-RTM).

Related

Run a query automatically SSMS without SQL server agent

I'm a new PowerBI developer.
I am inserting data from the Azure SQL database via SSMS.
I don't have access to a server agent for being able to create jobs.
I just want to run 4-5 queries (1 query = 1 step for my job). Is there a simple way to do this automatically for example?
Well, there's no server agent in Azure SQL DB, so you cannot create jobs as you do in on-prem or on Azure VM installations.
However, you do have Elastic jobs on Azure which can run queries on Azure SQL Database periodically.
See the documentation here.

How can I join tables from different databases in Azure SQL (SAAS)?

Having the older application that joins SQL tables from different databases like this:
SELECT a.value, b.value
FROM databaseA.dbo.tableA AS a
JOIN databaseB.dbo.tableB AS b
ON a.thekey == b.thekey
Being 3rd party, we have to accept the decision of the main implementor for the customer to use the license Azure SQL SAAS (Software As A Service; I am new to that, sorry if some terms are incorrect).
Is it possible to have databaseA and databaseB (that part is possible, checked through SSMS) in the Azure SQL and do the same JOIN (that part is unknown to me)?
I tried, but it failed. I do not know if something more have to be done to make the other database visible from each of the databases, or if it is not possible at all.
If it is not possible, what is the recommended technique to replace the old SQL code?
As you comment said: "I understand that it is different than working within one physical SQL Server. On the other hand, the different servers is probably related to possible replication. Is that correct? ", yes, you're right.
For Azure SQL database(PSSA), we only can use the elastic query to achieve the cross database query:
The elastic query feature (in preview) enables you to run a
Transact-SQL query that spans multiple databases in Azure SQL
Database. It allows you to perform cross-database queries to access
remote tables, and to connect Microsoft and third-party tools (Excel,
Power BI, Tableau, etc.) to query across data tiers with multiple
databases.
Note:
Make sure the primary database have the permission to access the remote databases. Add the the client IP to their database firewall. The remote database can be in different Azure SQL Server.
If you are using Azure SQL managed instance and Azure SQL Server on Azure VM, you can run this across query like on-premise SQL Server.

Querying multiple database systems

Is it possible to query (or better, join) data from two different database systems? Let's say I have postgresql and SQL Server and I want to join a table from postgres to a table in SQL Server?
It doesn't matter which programming language.
What about utilizing a linked server? I use one to query an AS400 and join the results back to Microsoft SQL Server.
Quote from Microsoft documentation:
Configure a linked server to enable the SQL Server Database Engine to
execute commands against OLE DB data sources outside of the instance
of SQL Server. Typically linked servers are configured to enable the
Database Engine to execute a Transact-SQL statement that includes
tables in another instance of SQL Server, or another database product
such as Oracle. Many types OLE DB data sources can be configured as
linked servers, including Microsoft Access and Excel. Linked servers
offer the following advantages:
The ability to access data from outside of SQL Server.
The ability to issue distributed queries, updates, commands, and transactions on heterogeneous data sources across the enterprise.
The ability to address diverse data sources similarly.

How to perform the same tasks in SQL SERVER IN SQL AZURE?

I connect my SQL AZURE to SQL SERVER 2008 R2.I realized that I can't use the GUI to create my tables, edit the design of the tables, insert.. update.. remove data, etc.
Is it possible that using SQL SERVER 2008R2 I can perform the last tasks using the GUI?
Another day I saw something about data synchronization with local database and azure, but I'm not sure what was that. I mention it if that is important for what I'm looking for.
you can use redgate toolbelt tool kit for data sync with SQL Azure . it is very very easy to use . SQL Azure dosen't provide same GUI as sql server 208 r2 . however Amazon RDS provide that facility . you can use management console for SQL Azure to view tables and data in SQL Azure .

Sync between Sql Server and Mysql Server

I have 2 big tables in sql server that i need to sync to mysql.
now, i need that as an ongoing process.
the tables are 1 GB each and getting new/update/delete row every 0.1 second.
Can you recommend me a tool that can do it that is not resource expensive.
you can offer OPEN SOURCE and commercial as well
Thanks
You could create a linked server instance in SQL Server, pointing to the MySQL instance. This article gives the step-by-step process. Once that is in place, providing you grant the MySQL user you connect on behalf of proper permissions, you can write to the MySQL instance as you like. So you could easily update stored procedures to do an additional step to insert records into MySQL.