Accessing Oracle database from SQL Server stored procedure. - sql-server

I was wondering if someone could give me some pointers on how to connect to an Oracle Database from stored procedure in SQL Server.

Firstly on your SQL Server server you will need to install Oracle Client Tools, the reason behind this is any machine that wants access to a Oracle Database will need the necessary Oracle Client Tools installed to access it.
Secondly you will need to configure the file "tnsnames.ora" that is installed with the above configured to point to the required Oracle Server/Database that you want to connect to.
Now you will need to create a Linked Server from your SQL Server management studio for that server to the oracle server.
Then in your stored procedure you have to follow the rule of:
[SERVER_NAME].[DATABASE].[OWNER].[OBJECT] in order of accessing thing on the oracle database, but keep in mind this is SQL Server syntax and there might be some minor twiking needed.
This is a rough outline and I hope it has set you on your way.

Related

How do I create a new server in SQL Server Management Studio?

The questions is basically the title because I could not find any articles to help as they only help on how to create a new database however I cant seem to create/join my own server.
The first picture attached is what I've seen other people do in order to get in however, I get an error when i try to connect
SQL Server and SSMS are two seperate softwares. SQL Server creates a database engine on your machine and SSMS is used to visualize or perform operations on these Database Servers. You Need to install both SQL Server and SSMS. While you seem to have install only SSMS.
You Can Install SQL Server from this link
SQL Server Download
You can follow this link to SQL Server Installation Tutorial

Want to have a SQL Server run query against a SQL Anywhere DB on another server

I have a SQL Server 2012 database on one server, and a SQL Anywhere 12 database on another server. I want to schedule a nightly select query that pulls data from the SQL Anywhere DB to the SQL Server DB.
This is all easily done between two SQL Server databases, even on different servers, but I have no option for "Microsoft OLE DB Provider for SQL Anywhere" and everything I find on the subject seems to assume that both the SQL Server and the SQL Anywhere DBMS are on the same server. That is not an option for me.
Is there some way I can get and install just what is needed on the SQL Server system to let me get the SQL Anywhere provider option? Legally and without involving additional licensing?
Microsoft OLE DB Provider for SQL Anywhere is exactly the right one.
This creates the necessary installer:
Start Menu\Programs\SQL Anywhere 16\Administration Tools\Deploy to Windows
Then just install it on the SQL server and you're ready to go.

Syncing a SQL Server CE database with a regular SQL Server database

There's an Umbraco site that various people been contributing content to. It runs on a hosted domain using a SQL Server Compact edition database for the CMS. It's about to go live and I need to sync the dev database to the live SQL Server instance which is hosted by a third party.
I just ass(u)me(d) that I could attach the .sdf to my local SQL Server and use a commercial tool (Redgate/SQLDelta etc.) to copy it to the live db. This does not seem to be possible. While I have managed to attach the .sdf using Linqpad, I can't connect to it like a regular database.
The best option seems to be to script out the entire database, but this seems like an impossible task using just Linqpad (no flies on Linqpad, obviously - it isn't the tool for such a task). Any less onerous options would be gratefully accepted.
You can use my free "SQL Server Compact Toolbox" Visual Studio extension for this. It can generate a script of the entire SQL Server Compact database, that you can then run against an empty SQL Server database.
In the past I did this kind of scenario wherein I need to copy the data from the SQL Server CE to a SQL Server database. Have you tried adding the .sdf to an ODBC then linked that ODBC to SQL Server?

Connecting Oracle to Microsoft SQL Server on 2 different servers

I am trying to make a connection between Oracle and SQL Server to insert some values from Oracle into SQL Server. I have 2 questions which i was hoping you can help.
There is a stored procedure created in Oracle 11g database. It joins a few tables together and pushes the values into a table called my_table in SQL Server.
The issue/question I have: I've tried to make a connection between Oracle and SQL Server using this link: Making a Connection from Oracle to SQL Server - Page 2 — DatabaseJournal.com
The instruction is however for when Oracle and SQL Server are on a same server.
As is my case Oracle is on one server and SQL Server is on another, I am struggling to understand the concept of setting up Listener and tbs.
Do I have to do any configuration on SQL Server? Do I need to create the DNS on SQL Server?
When I create a DNS in Oracle server, the connection to SQL Server is successful (port 1433) but I'm not sure how to alter my Listener and TNS for that.
My Oracle knowledge is not advanced but so far I've managed to get to this point. Hope you can help me resolve the last bit of the puzzle.

Proper way to Import data from Access to SQL Server?

I'm asking for the proper way, in SQL Server's T-SQL (I think that's what it is) code or using another language, to import data from a Microsoft Access MDB Database into a new SQL Server Database.
Now, typically I would just import it in. The problem is I'm writing a .SQL script (I could use another technology if needed) to do all this leg work as this will need to be done fairly regularly. Likely at least once a week, for about 5 months in the year.
To digress a tad, I had wanted to implement a single database and distinguish separate source database using something like a DatabaseID field, but the powers that be overthrew me there.
I was previously using SQL Server Management Studio 2012 with SQL Server 2008 running the T-SQL (on a production machine) that worked fine. I've now migrated to a local SQL Server Management Studio 2012 with SQL Server 2012 (for development) and the code that used to work doesn't anymore.
This code is what used to work: SELECT * INTO [dbo].[Controls] FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0', 'Data Source=C:\Show.mdb; Jet OLEDB:Database Password=BobSaget')...[Control] The password has been obfuscated for security ...
That's likely a sloppy solution. What's the ideal way?
Thanks in advance!
I would recommend using Microsoft's SQL Server Migration Assistant for Access.
SQL Server Migration Assistant (SSMA) is a free supported tool from Microsoft that simplifies database migration process from Access to SQL Server. SSMA for Access automates conversion of Microsoft Access database objects to SQL Server database objects, loads the objects into SQL Server, and then migrates data from Microsoft Access to SQL Server.
SSMA for Access v5.2 is designed to support migration from Microsoft Access 97 and higher to all editions of SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, and SQL Azure.
You can find it here.
You may need to fix the structure after the migration as it tends to over exaggerate many of the data types.
Have you checked your DCOM security on MSDAINITIALIZE?
I had this problem when moving to a local instance of SSMS 2012.
http://blogs.msdn.com/b/dataaccesstechnologies/archive/2011/09/28/troubleshooting-cannot-create-an-instance-of-ole-db-provider.aspx

Resources