SQL Linked Server to UTF-8 database - sql-server

I am trying to create a linked server from SQL Server 2008 R2 to an SAP IQ database, which has the UTF-8 Charset.
I am unable to get the correct characterset viewable on queries using this linked server.
I have tried everything, using native OLE DB provider of SAP IQ, using ODBC connectivity, playing with different connection strings, but my major concern is that it's impossible because SQL Server does not support UTF-8.
Correct characters when viewing in Interactive SQL:
Messed up characters in SQL Management Studio:
Any thoughts?

Finally solved it, after a few hours of debugging. :)
You have to use an ODBC connection, with the CharSet parameter set to 'windows-1252'. Then it works perfectly.

Related

Error inserting in Microsoft Access 2002-2003 "long Text" field SQL Server 2019 linked Server Microsoft Access Database Engine 2010 x64

I am attempting to migrate a number of stored procedures, which insert to Microsoft Access 2002-2003 format database files, as linked servers.
The process is currently working fine on the following configuration
Windows Server 2008 R2 Standard
SQL Server 2014
Microsoft Access Database Engine 2010 x64 - v14.0.7015.1000
The updated configuration is as follows
Windows Server 2019 Datacenter
SQL Server 2019
Microsoft Access Database Engine 2010 x64 - v14.0.7015.1000
The Microsoft.ACE.OLEDB.12.0 has registered fine on the newer server configuration, and is available as a linked server "provider"
The SP inserts to a number of tables, with varying data types, and all are successful, with the exception of fields where the SQL Server field is of type nvarchar and the Access mdb field is of type "Long Text", where I get the error.
Msg 7344, Level 16, State 1, Line 182
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "[Access mdb Linked Server Name]" could not INSERT INTO table "[Access mdb as Linked Server]...[Table Name]" because of column "[Column Name]". The column had a bad status.
The Long text fields in the Access mdb are reported/displayed as varchar data type, in the linked server configuration.
I have tried writing simple, short, strings to the field, CASTing as varchar data type, but still get the same error.
I've done lots of googling, but can find no examples of others experiencing similar issues.
I suspect it is a compatibility issue, between the SQL server version and access database engine but, again, have been unable to find any useful resource.
Has anyone experienced a similar issue, and found a resolution?
Or if you can direct me to a suitable resource where I can find more info.
I managed to resolve this, with changes to the configuration of the OLEDB provider on the SQL server.
It was necessary to enable both:
Dynamic Parameter
and
Allow inprocess
in the provider Options

Unreadable value returned in VBA/ADO from SQL Server 2019

To monitor SQL Server jobs in a VBA app, I run the sp_get_composite_job_info stored procedure from the msdb database using ADO. I check the current_execution_step field once I have the results in a ADODB.Recordset. This has worked fine with SQL Server 2012 for years.
We just migrated to SQL Server 2019 and now the same code which still works on SQL Server 2012 is returning an unreadable value for the current_execution_step field.
Instead of "4 (Step Name)", I get a bunch of rectangles and squares.
If I run the same call to sp_get_composite_job_info in SSMS, I can read the current_execution_step field just fine on both servers. It's only when I try to read that field in VBA/ADO that it's gibberish.
What's worse, I can read other fields from that same recordset just fine. It's only this one field (which just happens to be the only field I need to read) that is unreadable.
The driver I'm using in VBA is ODBC Driver 17 for SQL Server. But again, I use the same driver for both servers, and only 2019 has this issue.
What could be causing this?
The SQL Server 2012 version of sp_get_composite_job_info (undocumented as #RBarryYoung mentioned) returns current_execution_step as nvarchar(128) whereas SQL Server 2019 returns nvarchar(MAX).
ADO is unaware of SQL Server datatypes introduced after SQL Server 2000. Try installing the latest MSOLEDBSQL OLE DB driver (ADO is natively OLE DB) and specifying the DataTypeCompatibility=80 in the connection string.
Fortunately, the answer was as simple as going back to OLE and switching the Provider to SQLNCLI11 instead of SQLOLEDB. Since SQLNCLI11 is omnipresent, I don't have to hunt down all of the machines that might use these apps and install MSOLEDBSQL on them.

SQL server linked server to SAS(Statistical Analysis System)?

has anyone ever been able to create a sql server linked server to SAS?
I have created an ODBC connection (32bit) to SAS
This ODBC works for e.g. QlikView, Tableau etc.. but how would set it up for SQL server?
Provider?
Product name?
Data Source?
Location?
Catalog?
If the DSN is already created, you can access it in SAS directly using:
libname myServer odbc dsn=PROD_PL0000 schema='dbo';
Then you'll see it as a SAS library that you can work with natively. If you do it via the GUI you can check a box to have it reconnect at start up.
I also have the same problem. The problem is in the SAS provider for OLE DB connections, it can't create a popular instance with SAS tables.
To create the linked server via OLE DB you need to go to the SAS website, download the files and install on the SQL server to set up the connection.
https://support.sas.com/downloads/package.htm?pid=648

Connection is busy with results for another hstmt in delphi

i have developed a application in Delphi using Paradox and bde , now am migrating it into sql server 2008,
i have a lot of table and query components in every form, so am just create user DNS in ODBC manager with 'Sql Server - Driver' , and configure with BDE(connect sql server via BDE),
The problem is , while am working in some form, the error raised like
Connection is busy with results for another hstmt
Am tried with Sql native clinet , but i gives lot of troubles for me, so am using sql-server driver,
please any one help me to fix this problem, or give a steps to migrate paradox to sql server wihtout using 3rd party componets and ado,,,,
Try to set MARS_Connection=yes for your DSN.
SQL Server Driver has few issues when it works with SQL Server 2008. So, consider to use SQL Native Client 10.

Linked connection between MS SQL SERVER and Sybase ,Unicode problem

I added linked server on MS SQL SERVER 2008 with Sybase ASE 12.5 databases,
everything works fine, but i've got problem with unicode strings.
from MS SQL when i'am running
"SELECT * FROM OPENQUERY ( SYTEST ,'SELECT Name FROM PRODUCT')"
and the result set contains wrong characters
a?›a??a??a? a?”
a??a??a?¬a??a? a??
Name column in Sybase is of nvarchar type , names are written in unicode.
Problem occurs only when ms sql server is running on windows server operating system,
There is no problem on ms sql-servers running on Windows 7 and XP, where I got correct result.
try to use N#parameter when making query
If it works on 2 separate installs, you compare and check the linked server settings using sp_serveroption, especially collation compatible and collation name
If these are the same, check any DSN and Sybase driver settings in the OS
There is a case like this in my company
I've created a linked server from SQL Server 2014 to the IBM AS/400 (i series) and faced with the same problem.
I'm not sure about the different between 2014 and 2008 handle the unicode chars but I think it not much, if any.
How to
1. login to the SQL studio
2. right click the linked server then select "properties"
3. select "Server options" in left pane
4. set "Use remote collation" to "True"
5. in "Collation name", choose your unicode (here is the basic list - https://technet.microsoft.com/en-us/library/ms180175%28v=sql.105%29.aspx"
My problems solved this way! (I played a lot with connection strings with no desired results)

Resources