How to connect two databases at the same time in SQL Server? - sql-server

How to connect to two databases at the same time in SQL Server?
i want to create a query from a local database db1 on some tables exist in an outside database db2. Im working with SQL Server.

The servers will need to be connected as a Linked Server in Server Objects, Linked Servers with a user that has access to both servers.

Related

Connect to SQL Server query from Excel

i am trying to connect to a query that is build in sql server, but i cannot find where is it saved (the address). Just to clarify - no trouble connecting to tables on the same server.
You can't connect to a query in SQL Server from Excel.
You can connect and retrieve data from tables and views.

How can I move data from SQL Server to Oracle?

I have created my database and tables in a SQL Server Express database. And now I migrated the database tables to Oracle with Entity Framework. But my tables are empty in Oracle. How can I move my data to Oracle?
Use SSIS interface from MS-SQL (Sql Server Integration Service).
I have used to move content from MSSQL to MySQL you should use the correct odbc driver.
For express edition, You can use Linked Servers to establish connection between SQL Server and Oracle. In this way, you should insert the records by creating queries for per table.
https://learn.microsoft.com/en-us/sql/relational-databases/linked-servers/linked-servers-database-engine

Powerbuilder 12.6 connection to a SQL Server linked server

Do you know how to set SQLCA connection parameters in order to connect my pb 12.6 app to a linked server on SQL Server 2012?
We already connect to a SQL Server database but we also need to connect to a linked server on this database (customer requirement)
Any hints?
Thanks
Linked server happens at the server side. No change to login. To access the tables you will need to use the link name and database name in sql. To make it easier I would create views in your database that refer to the linked database table. Then you can use the view name in your app.

Azure SQL get data from another non-Azure sql server using Linked Server

We have two SQL Server Database (EG: DB1 & DB2) that are hosted in NON-Azure environment (dedicated server). We are planning to migrate DB1 to Azure SQL.
Is there way the Azure SQL DB1 can talk to non-azure DB2 using Linked Server approach? I want to query in my Azure SQL (DB1) and get the data of DB2.
If I understand correctly you are trying to connect your Azure-db (DB1) from an on-premise db (DB2). From on-premises SQL Server, you can use linked servers and 4-part names to point to a database in Azure SQL DB using a datasource which would look like this -
[YourAzureServerName#database.windows.net].[YourDatabaseName].[YourSchemaName].[YourTableName]
For more details please check this link.
Yes you can certainly do that.
This atricle explains all the details that you need to do to accomplish that:
https://www.mssqltips.com/sqlservertip/3630/connect-an-azure-sql-database-to-an-onpremises-sql-server/
Note that your SQL Azure instance needs to be in "Standard" service tier to be able to do that.
If you want to add your SQL Azure server as a linked server to your on-prem SQL you can use ODBC connection.
Bellow MSDN article will help you with that:
https://blogs.msdn.microsoft.com/sqlcat/2011/03/07/linked-servers-to-sql-azure/

Verify 2 SQL Server linked servers to Oracle are equal

I am migrating SQL Server 2005 to SQL Server 2012.
One of the items to migrate is a linked server to oracle. The configuration of server, DNS, firewall, etc are not on my side.
I need to make sure they are configuring the correct linked server, pointing to the correct database (we have many copys of databases).
What Query can I run in both sql servers to identify the Oracles servers and databases are the same?
You can show all linked servers from the sys.servers table on each of the server instances.
select * from sys.servers;
The linked Oracle server will be listed under:
product = `Oracle`
and provider = `OraOLEDB.Oracle`

Resources