Create view in Oracle SQL Developer from Microsoft SQL Server Management Studio - sql-server

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

Related

Move MS Access tables to be used in SQL Server

I'm using MS Access 2013. I have a some tables which I would like to migrate to SQL Server 2012 (Management Studio). I want these tables to be used in SQL Server for addition etc., but I also want these tables to show as 'linked' in MS Access.
How do I make it so the tables look populated in MS Access, but are manipulated from SQL Server?
The Migration tool in SQL Server did not give me my desired results.
I'm not sure why you want to move it to SQL server from Access. If you say it is just for addition purposes, that is a really bad idea to move from Access.
You will need to create a shell database in SQL Server.
From Access select > External Data > More > ODBC Database and follow the prompts to export the data into SQL Server.
After that select > External Data under Import and Link > ODBC Database
This will link the local Access table to the SQL Server table and you will be able to run queries you require.
Create Database in SQL Server https://msdn.microsoft.com/en-us/library/ms186312.aspx#SSMSProcedure
Migrate Data from Access to SQL Server. For Access 2013 you will need to use the SQL Server Import and Export Wizard. Search the start menu for "Import and Export Wizard". It comes installed with SQL Server. For the data source choose Microsoft Access and follow the steps.
How do I make it so the tables look populated in MS Access, but are manipulated from SQL Server? Create a linked table via ODBC connection. https://support.office.com/en-us/article/Import-or-link-to-SQL-Server-data-a5a3b4eb-57b9-45a0-b732-77bc6089b84e

Can not modify stored procedure on Azure

I'm new to Azure SQL database.
I managed to migrate my database to the cloud.
Now I'm trying to modify a stored procedure using Microsoft SQL Server Management Studio (the latest edition - 2014). But get the following error message:
USE statement is not supported to switch between databases. Use a new
connection to connect to a different database.
Any idea how can I do this?
Also, is there any alternatives to Microsoft SQL Server Management Studio to work with Azure SQL Database?
USE in sql is used to switch between databases not to modify stored procedures. You cannot use USE on Azure SQL as per the specification. You should be able to right-click on the database name in Microsoft SQL Server Management Studio (SSMS) and select New Query, or you can use the dropdown list in the menu to switch databases. You can then use ALTER PROCEDURE (https://msdn.microsoft.com/en-GB/library/ms189762.aspx) to alter your procedure.
You can use Visual Studio as an alternative to SSMS but IMHO Visual Studio is not as productive. It doesnt matter which client you use though, because USE wont work in any of them.

linked server compares between Oracle and SQL 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

Connect to MS SQL server from PL/SQL Developer

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 can't use a database in SQL Azure

I am trying to use a Database in SQL Azure. I have installed SQL Server 2008. I can Login SQL Azure and can use master Database. But I can't use other Database and I can't see any things in my object explorer. It shows this error:
"USE statement is not supported to switch between databases. Use a new connection to connect to a different Database."
How can I use another database?
You cannot link to another database server from SQL Azure, whether that other database is SQL Server or SQL Azure.
I found the Solution for this problem . I install SQL Server 2008 R2. then every thing is ok...
You can first create only the database before running the whole script to create schemas & Tables.
Then manually change the database to the new DB that was created.
Run the rest of the script. Do not run Use <databasename>

Resources