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)
Related
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.
There is some kind of pre-processment of the SQL text on FireDAC queries that truncates their string literals containing ! characters.
It's very easy to replicate:
Place a TFDConnection, a TFDQuery connected to the connection, a TDatasource connected to the query and a TDBEdit connected to the datasource.
After setting my server configuration on the TFDConnection, if I try this SQL on the TFDQuery : Select 'Hel!o World' as column, I would only see He on the TDBEdit instead of Hel!o World.
It's a problem of FireDAC because the same query runs fine directly on SQL Server Management Studio.
Is there a way to fix o disable this pre-processment of FireDAC ?.
It's Delphi 10.4 and SQL Server 2017 accessed by SQL Server Native Client (I have also tried the same query on Delphi 10.3 and returns the same error).
Thank you.
I have two Windows 2008 Server 64x machines. One running Oracle 10.2.x.x.x (Express Edition) and other SQL Server 2008 R2 with ODAC 12c (12.1.0.2.4).
I had created linked server, tested connection and it passes. I can see all Oracle tables, but when I query them, for example:
SELECT *
FROM ORACLE..USER.PERSON
All I get back are columns without no rows. If I run query from Oracle SQL Developer I get around 13000 rows.
What could be problem? I thought it was problem with backward compatibility, but according to this link it is not. It could be something with permissions/security?
Well it was nothing to do with linked server configuration. I didn't know that after every insert I need to commit changes.
SQL> commit;
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.
I am working on an Access accdb project and I have all my tables linked to MS SQL Server 2008 R2 via ODBC.
I have one screen with a sub form that always gives me this error message when I enter it:
I've done some research and it it supposed to be related to the server's authentication method, but if all my tables are linked the same way, why does it happen?
What's even more weird is that if I refresh my table's connections via the linked table manager, everything works fine for some time, and then I get the same error again. I look through my code to see if I play with any connection string, but I don't.
Any thought/ideas? Any (educated) guess you have will be appreciated :)
Thanks,
Yotam
Go to Start > Programs > Microsoft SQL Server 2005 > SQL Server Management Studio
Right-click the Server name, select Properties > Security
Under Server Authentication, select SQL Server and Windows Authentication Mode.
The server must be stopped and re-started before this will take effect.