I have tried linking an AS/400 to SQL Server using the following drivers: "IBM DB2 for i IBMDASQL OLE DB Provider", "IBM DB2 for i IBMDA400 OLE DB Provider", and "IBM DB2 for i IBMDARLA OLE DB Provider". The connections test successful, but when I run this SQL:
SELECT DISTINCT COLUMN_NAME FROM AS400.MyCatalog.SYSIBM.SQLCOLUMNS
or
SELECT *
FROM OpenQuery(AS400, 'SELECT DISTINCT COLUMN_NAME FROM SYSIBM.SQLCOLUMNS');
I get the following error:
OLE DB provider "IBMDARLA" for linked server "AS400" returned message "CPF4326: Commitment definition *N not valid for open of SQLCOLUMNS.".
Msg 7306, Level 16, State 2, Line 1
Cannot open the table "Tmxloop.SYSIBM.SQLCOLUMNS" from OLE DB provider "IBMDARLA" for linked server "AS400".
Completion time: 2022-03-29T10:46:59.3399022-04:00
How do I get at least one of the connections to accept my SQL queries?
Use Driver
"IBM DB2 for i IBMDASQL OLE DB Provider"
Under Providers update driver "IBMDASQL" to "Allow inprocess"
Now SQL will work
SELECT DISTINCT COLUMN_NAME FROM AS400.MyCatalog.SYSIBM.SQLCOLUMNS
Related
We are trying to pull unicode data from Cloudera Impala into SQL Server. We have done the below steps:
We have installed Cloudera Impala ODBC driver and configured DSN. We have enabled "SQL Unicode Types" in the DSN settings.
We have created linked server in SQL Server accordingly for the DSN. We have set the option "Collation Compatibility" to True.
When we run the below query, we are getting error as given below:
SELECT *
from openquery
(LinkedServerName,'SELECT columnName from SchemaName.ViewName where col_id = ''ABCDEFGH''')
OLE DB provider "MSDASQL" for linked server "LinkedServerName"
returned message "Requested conversion is not supported.". Msg 7341,
Level 16, State 2, Line 1 Cannot get the current row value of column
"[MSDASQL].columnName" from OLE DB provider "MSDASQL" for linked
server "LinkedServerName".
We also tried below CASTING:
Using CAST to VARCHAR(50)
SELECT CAST(columnName AS VARCHAR(50))
But, we get the below error:
Msg 7355, Level 16, State 1, Line 1 The OLE DB provider "MSDASQL" for
linked server "linkedServer" supplied inconsistent metadata for a
column. The name was changed at execution time.
Note:
When we disable "Enable SQL unicode datatypes" in DSN settings, we are able to pull data without issues. But, the unicode characters are coming as boxes.
can you please help us, in resolving the issue.
We were able to fix the unicode issue, by going with below settings for cloudera Impala ODBC 64 bit driver and linked server.
64 bit ODBC driver settings in DSN for cloudera Impala
Linked Server settings in SQL Server
I am configuring a linked server in SQL Server in order to send data from a SQL Server database to a MySQL database. While creating the linked server, in the fields to fill, I am asked the Provider string, unfortunately, I do not know what the Provider String is. Can somebody tell me what the Provider String is and how I can get it?
Here is a screenshot of the window where I need the Provider String
From the documentation Create Linked Servers (SQL Server Database Engine):
Provider string
Type the unique programmatic identifier (PROGID) of the OLE DB provider that corresponds to the data source. For examples of valid provider strings, see sp_addlinkedserver (Transact-SQL).
And then from that linked documentation:
[ #provstr = ] 'provider_string'
Is the OLE DB provider-specific connection string that identifies a unique data source. provider_string is nvarchar(4000), with a default of NULL. provstr is either passed to IDataInitialize or set as the DBPROP_INIT_PROVIDERSTRING property to initialize the OLE DB provider.
...
Remarks
The following table shows the ways that a linked server can be set up for data sources that can be accessed through OLE DB. A linked server can be set up more than one way for a particular data source; there can be more than one row for a data source type. This table also shows the sp_addlinkedserver parameter values to be used for setting up the linked server.
Remote OLE DB data source
OLE DB provider
product_name
provider_name
data_source
location
provider_string
catalog
SQL Server
Microsoft SQL Server Native Client OLE DB Provider
SQL Server 1 (default)
SQL Server
Microsoft SQL Server Native Client OLE DB Provider
SQLNCLI
Network name of SQL Server (for default instance)
Database name (optional)
SQL Server
Microsoft SQL Server Native Client OLE DB Provider
SQLNCLI
servername\instancename (for specific instance)
Database name (optional)
Oracle, version 8 and later
Oracle Provider for OLE DB
Any
OraOLEDB.Oracle
Alias for the Oracle database
Access/Jet
Microsoft OLE DB Provider for Jet
Any
Microsoft.Jet.OLEDB.4.0
Full path of Jet database file
ODBC data source
Microsoft OLE DB Provider for ODBC
Any
MSDASQL
System DSN of ODBC data source
ODBC data source
Microsoft OLE DB Provider for ODBC
Any
MSDASQL
ODBC connection string
File system
Microsoft OLE DB Provider for Indexing Service
Any
MSIDXS
Indexing Service catalog name
Microsoft Excel Spreadsheet
Microsoft OLE DB Provider for Jet
Any
Microsoft.Jet.OLEDB.4.0
Full path of Excel file
Excel 5.0
IBM DB2 Database
Microsoft OLE DB Provider for DB2
Any
DB2OLEDB
See Microsoft OLE DB Provider for DB2 documentation.
Catalog name of DB2
So you can choose the appropriate value of the provider from the OLEDB source you are using for your linked server.
INSERT data From IBM i-series database (Created Linked server connection -SOFT) table into SNOWFLAKE database table (Created Linked server connection -SF_64)
Linked server connection(Created in One of the SQL server)
SOFT - linked server connection with IBM Iseries Database
SF_64 - linked server connection with IBM Iseries Database
INSERT INTO [SF_64].[PROD].[REPORTING].[DPMPPHY_SSIS_TESTING]
SELECT * FROM OPENQUERY(SOFT, 'SELECT * FROM ABC.DPMPPHY')
Getting below error wile executing above query in SQL server
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSDASQL" for linked server "SF_64" reported an error. The provider did not give any information about the error.
Msg 7312, Level 16, State 1, Line 1
Invalid use of schema or catalog for OLE DB provider "MSDASQL" for linked server "SF_64". A four-part name was supplied, but the provider does not expose the necessary interfaces to use a catalog or schema.
INSERT INTO OPENQUERY(SF_64,'SELECT * FROM REPORTING.DPMPPHY_SSIS_TESTING') SELECT *FROM OPENQUERY(SOFT,'SELECT * FROM ABC.DPMPPHY')
i'm trying to connect from sql server to oracle server with OPENROWSET for fetch data.
this is my query:
SELECT a.*
FROM OPENROWSET(N'OraOLEDB.Oracle', N'Data Source=Myip:Port/dbname';'User Id=user';'Password=pass;',
'select * FROM view WHERE value = ''102030'' ') AS a;
sql return below error:
OLE DB provider "OraOLEDB.Oracle" for linked server "(null)" returned
message "ORA-12154: TNS:could not resolve the connect identifier
specified". Msg 7303, Level 16, State 1, Line 23 Cannot initialize the
data source object of OLE DB provider "OraOLEDB.Oracle" for linked
server "(null)".
how can i fix this ?
I used Linked Server for fetch data but oracle table not small and it takes a long time to execute.
I am trying to connect Oracle 9i database using SQL Management studio 2008.
I tried this but it doesn't work
EXEC sp_addlinkedserver 'OracleLinkedServer','Oracle','OraOLEDB.Oracle','TestDB';
EXEC sp_addlinkedsrvlogin 'OracleLinkedServer','false','SA','TestUsername','TestPassword';
I am able to create the linked server and it test correctly,
But when I execute this statement:
SELECT sysdate FROM OracleLinkedServer...dual;
...it gives an error:
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer" reported an error. Provider caused a server fault in an external process.
Msg 7311, Level 16, State 2, Line 1
Cannot obtain the schema rowset "DBSCHEMA_TABLES" for OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer". The provider supports the interface, but returns a failure code when it is used.
You should UNCHECKED the Allow inprocess in OraOLEDB.Oracle provider under the Linked Servers node.