Difference between .NET, OLEDB, and Native Providers in SSIS - sql-server

I am pretty confused with the plethora of OLEDB providers found in creating a connection to a database in SSIS 2008 R2.
I would much appreciate if you could tell me what the following providers stand for and when is best to use them:
.Net Providers for OleDB
Microsoft OLE DB Provider for SQL Server
SQL Server Native Client 10.0
Native OLE DB
Microsoft OLE DB Provider for SQL Server
SQL Server Native Client 10.0
I am pretty unsure which provider to use out of these if I want to create an OLE DB connection to the database in question. Additionally, I am confused why the same type of provider appears both in .Net and Native.

Here's some more detailed information about the main two connections (OLE DB and ADO.NET). It seems to me that ADO.NET is better in the sense that it should work more universally in different environments.

You really don't have to worry too much about which one to use, select the Native one (SQLNCLI) and it'll work fine out of the box.

Related

A Common ODBC Connection Strings works for SQL Server 2005+

I am using CDatabase in VC2008 to connect to SQL Server via ODBC.
I want to use a common connection string that can work for SQL Sever 2005 and all higher versions.
I check https://www.connectionstrings.com/microsoft-sql-server-odbc-driver/ and see there are many different kinds of connection strings.
Whether I should use:
Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;
or
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;
Uid=myUsername;Pwd=myPassword;
Pwd=myPassword;
Update:
Based on my test, using Driver={SQL Server} or Driver={SQL Server Native Client 10.0} can both connect to SQL Server 2008. I guess the former will works for all SQL Server versions, but the latter will only works for SQL Server 2008. Please confirm my guess.
Both driver will connect to Sql Server.But purpose of both drivers are different.
Driver={SQL Server} :
It is called Windows Data Access Components (WDAC).
It do not support new feature of Sql server 2005+ like xml data type,Multiple active result sets (MARS), user-defined data types (UDT), query notifications etc.
It support only Read Committed transaction isolation.
Driver={SQL Native Client}
This driver is suitable for application that need to take advantage of new feature of Sql server 2005+.
It support both Read Committed transaction and snapshot transaction isolation level.
System.Data.SQLClient
SQLClient is optimize for .NET and database Sql server 2000+.
It give maximum performance.
So if your application is new or existing then use SQL Native Client.It can access all feature of connected version of Sql server 2005,2008 etc.
ODBC :Use ODBC when application is connected to multiple database or it is expected that database may change.DAL code is written in such a manner it will work for any database.
Suggested Reading
Common Connection : I don't think there can be any common connection.Suppose in my system SQL server native client 10 is install then I know that I cannot connect to Sql server 2016 + .SQL server native client 10 will work for Sql Server 2016 and below.
Of course by programming we can make dynamic connection string which will accept driver as parameter etc.
To connect to higher version ,s I will hv to upgrade my driver and do minor change in connection string.Or if you don't want to touch code then Use DSN.
Yes I forgot, Driver={SQL Server Native Client} it can connect to Sql Srver 2005 only.if you try to connect to higher version then it will throw error.

Can't create a linked server connection on SQL Server 2014 to Oracle 11g

I am trying to create a linked server in SQL Server 2014. I am attempting to connect to an Oracle 11g server. I am using the Oracle in OraClient 11g connection provided by Oracle. The ODBC connection is set up on the Server and I can test connect, so it works though Windows.
I right click on the Linked Servers in the database and choose Other Data source. There is no Oracle provider option there. If I try and force it using the Microsoft OLE DB Provider for ODBC drivers, the connection returns an error message that says "An exception occurred while executing a t-sql statement. Cannot initialize the data source object of OLE DB provider "MSDASQL" for Linked server "Server". OLE DB provider "MSDASQL" for linked server "Server" returned message "[Micrsoft][ODBC Driver Manager] Data Source name not found and no default driver specified." (Microsoft SQL Server, Error: 7303)
It appears I am missing something, a way for the sql server to recognize the connection, but I can't figure out what. Any guidance would be appreciated.
According to SQL Mag:
Before you can create a SQL Server 2008 linked server to Oracle, you
need to install the Oracle client software on the SQL Server 2008
system. The Oracle client software provides the network libraries that
are required to establish connectivity to the Oracle database. In this
case, the Oracle 11g database server is already installed and
functional. Installing the Oracle client software on the SQL Server
system enables it to connect to the existing Oracle server.
The article applies to 2008/11g but the principle should be the same on 2014/11g.
Took me a couple of days u I found this:
https://nampark.wordpress.com/2011/01/20/installing-64-bit-odac-11-2-to-microsoft-sql-server-2008-r2-x64-for-replication/
It gives a great walk through of how to install the missing components I need. The downside to this solution is that it requires the installation to be done via cmd window. Not something I have much experience with, but this walk through really gave me the details I needed to get it done. That cleared the error message I was getting.

What provider should I choose for my VB6 ADODB connection to SQL Server 2014?

I'm not sure how to interpret this quote from the MSDN documentation. Is the native client deprecated?
There will be no more updates to the ODBC driver in SQL Server Native Client. The successor to the ODBC driver in SQL Server Native Client, which is called the Microsoft ODBC Driver 11 for SQL Server on Windows, is installed with SQL Server 2014.
The OLE DB Provider in SQL Server Native Client was last updated in SQL Server 2012 Native Client. Developers who wish to use an OLE DB provider to connect to the latest version of SQL Server must use the OLE DB provider that shipped in SQL Server 2012 Native Client.
I also found this statement on msdn.
Microsoft has announced the deprecation of the SQL Server Native Client OLE DB provider, and that SQL Server 2012 is the last version of SQL Server to support the provider. This article provides guidance for converting SQL Server or SQL Azure applications that use OLE DB to the ODBC API.
Connection string samples for the different suggestions is also helpful :)
These statements imply that the older drivers will no longer receive updates, and instead will be replaced by newer drivers. You should test your VB6 app using the new Microsoft ODBC Driver 11 for SQL Server on Windows. OLE DB and ODBC are independent technologies, so the quotes you found do not relate to each other. The first quote applies to your situation. My suspicion is that it will simply work. ODBC drivers are agnostic to the language the calling applications are written in, so you'll be fine.
I believe all of this reflects Microsoft's move away from desktop Windows as the primary client platform as they move their server products (e.g. SQL Server) into Azure.
The Linux and Apple ecosystems never adopted COM, and so stayed away from OLE DB since they lacked the necessary infrastructure. The same remains true for younger OSs such as Android and Chrome OS.
On the other hand while ODBC is a cruder technology it has been widely adopted outside of Windows, spawning thin wrappers and work-alikes such as JDBC drivers.
By moving away from Windows technologies such as OLE DB Microsoft is in a better position, both to support other client OSs and to move SQL Server to another OS running in Azure since they see a "Windowless" future ahead.
...
As far as VB6 development goes in the interim, I'd stick with the SQL Server 2012 Native Client OLE DB provider just as Microsoft suggests. But you might want to begin looking elsewhere for client development tools since VB6 and even VB.Net appear to be nearing the end of the road. Soon there might not be a lot left of .Net at all aside from C# supporting the bits and pieces in .Net Core.

To which DBs can I connect via DB LINK, from Microsoft SQL Server 2012?

I'd like to know to which DBs can I connect, via DB Link, from a Microsoft SQL Server 2012 DB?
Is there a list?
I assume that by "DB link" you mean a "linked server"? There is no list, because as the documentation says:
SQL Server distributed queries are designed to work with any OLE DB
provider that implements the required OLE DB interfaces. However, SQL
Server has been tested against only the SQL Server Native Client OLE
DB Provider and certain other providers.
And:
OLE DB providers vary greatly in the type and number of parameters
required. For example some providers require you to provide a security
context for the connection using sp_addlinkedsrvlogin (Transact-SQL).
Some OLE DB providers allow SQL Server to update data on the OLE DB
source. Others provide only read-only data access. For information
about each OLE DB provider, consult documentation for that OLE DB
provider.
In other words, you can use any OLE DB provider to create a linked server but configuration and behaviour varies a lot.
MSDN includes a list of tested providers, although there is no SQL Server 2012 version of the page.

Crystal Reports, which OLEDB provider to use for SQL Server

When designing a new Crystal Report you have to create a new database connection. I have selected OLE DB (ADO) as the 'driver' as it made more sense than DAO,RDO or the other options for my requirements.
I need to execute an SQL Server 2005/2008 stored procedure on a remote server and show the results in Crystal Reports on a .NET client.
Selecting OLE DB, presents me with further options to select the correct provider, some of which are:
Microsoft OLEDB provider for ODBC drivers
Microsoft OLEDB provider for SQL Server
SQL Native Client
SQL Server Native Client 10.0
Which on is the best to use?
I don't want to use the ODBC drivers, for various disadvantages (setting up ODBC definitions and maybe slower).
Not sure how the OLEDB provider for SQL Server compares with the native client
The native client forced me to run the native client setup on each desktop. It also seems that there is different version for each version of SQL Server.
Initially I thought the native client is the logical choice for compatibility and performance but deployment seems to be an issue (unless I am doing something wrong)
What is the best connection driver/provider combination to use here?
I would go with the Microsoft OLEDB provider for SQL Server. If you use the native client, you will need to distribute it with your applications.
This article talks about the native client in detail: http://blog.flex2sql.com/index.php/2009/02/how-and-when-to-use-sql-server-native-client/

Resources