I have a SQL Server database that was recently moved to Azure. I have created a linked server in the local SQL Server to the Azure database. I can run the query in SQL Server Management Studio and it returns the the data I am expecting. When I run this query in my Delphi app I get an error.
Error: Reference to database and/or server name '...' is not supported in this version of SQL server.
Example of the query I am trying to run.
Select t1.field1, t2.field2
from <linkedserver>.<database>.<dbo>.<table1> t1
join <localserver>.<database>.<dbo>.<table2> t2 on t2.id = t1.id
you must use Native Client for Provider connection type.
Related
I have two databases; SQL Server uses SSMS to connect and Oracle DB uses Oracle SQL Developer to connect.
I want to create a view in Oracle database from SSMS.
I tried this code in SSMS:
CREATE VIEW LINKDB_ORACLE..user_oracle.ViewCreate_OnOracle
AS
SELECT UserId, UserName
FROM [dbo].[Users]
When I run this query, I get this error:
The object name 'LINKDB_ORACLE..user_oracle.ViewCreate_OnOracle' contains more than the maximum number of prefixes. The maximum is 2.
How to I can query data from SQL Server use Oracle SQL Developer, if not use view method above.
I use SQL Server 2012 and Oracle 12c
You can't use this syntax, it will be easier to create all views using Oracle Tools.
From Microsoft documentation:
A view can be created only in the current database. The CREATE VIEW must be the first statement in a query batch.
Create-view-transact-sql
If you have to use SSMS, you can try syntax:
EXEC ('CREATE VIEV...') AT linked_server
If you want to see SQL Server data from Oracle database, then check this post:
Oracle equivalent for linked server
We are doing a migration from Oracle 10g to SQL Server 2014. Once I set up the linked Server connection in SQL Server to the Oracle DB will I be able to run a statement like the following:
select * from linkedservername...schema.table
except
select * from Servername.database.schema.table
Not all queries will be this easy as I'll have to do some data manipulation on the oracle side. Will I need to use Oracle syntax for that or once I have the linked server set up will everything be in T-SQL for querying purposes?
Thanks
I am trying to compare SQL Azure vs AWS Sql server. SQL Azure clearly lists the limitation . I am trying to find the same on AWS SQL Server. My applicaiton currently uses cross database query. Which is not supported by Azure. Is AWS RDS Sql server supports cross database query?
I had exactly the same question and decide just to have a go and see, the short answer is yes you can.
Basically you start up a SQL server instance in which you can create multiple databases and query across them as you would in any other standard SQL server instance
Yes you can!!
You can do cross database query in AWS SQL Server Instances. I'm doing cross database query with aws sql server instances for 2+ years now.
The following is the syntax
[Database_name].[Schema_name].[Table_name]
Example
Select u.[UserName], a.[Balance] From [db_detail].[dbo].[user_details] as u
INNER JOIN [db_account].[dbo].[acount_overview] AS a ON a.UserID = u.[UserID];
I have PL/SQL Developer installed on my machine.
Version:-7.1.2
I want to connect to MS sql server from PL/SQL Developer. I have SQL server address, username and password with me.
I tried to search for the solution every possible way.
Can anybody help me with this?
You cannot. Directly from their web page (emphasis mine):
PL/SQL Developer is an Integrated Development Environment that is specifically targeted at the development of stored program units for Oracle Databases.
To connect to MS SQL Server from your desktop you need SQL Server Management Studio (free), Azure Data Studio (free), Toad for SQL Server ($$$), or another client that advertises connectivity to SQL Server.
open sql server from server objects add a linked servers to oracle
add stored procedure that will insert into the table in oracle and reads from sql table.
example:
INSERT INTO OPENQUERY (ERPTEST, 'SELECT EMPLOYEE_ID,FIRST_NAME FROM EMPLOYEE')
select Employee_Number,Full_Name_1 from [EmpDB].[dbo].[EMPLOYEES];
I am not too familiar with how the linked remote databases work in SQL Server. But I am trying to query to a linked remote oracle database table using SQL syntax on SQL Server. I am having a issue trying to query a ROWID, which is proprietary to Oracle PL/SQL.
This is query I am trying to use:
select t.*, t.rowid
from owner.DMIS_TBL t
Is there a way to input a Oracle based query in SQL Server for a remote database? Querying all other columns in the Oracle tables works fine but if I specify the ROWID it does not recognize it.. I know the ROWID this is a pseudo column but I need to have this for migration purposes to use as the record id in SQL Server. Maybe it won't work in SQL syntax because the datatype is ROWID and SQL Server doesn't support this.