Hi everyone!
I have connected SAS code to SQLserver but the dataset can't display Thai character. But when I have tried connecting SAS code to PostgreSQL, it works and displays Thai character perfectly fine. However I need to connect with SQLserver. Please advise me. Thank you in advance.
My code:
libname sslib1 sqlsvr noprompt="DRIVER=SAS ACCESS to MS SQL Server;
UID=my UID ;PWD=my Password;
HOST=My host ;PORT=My port; schema=dbo";
And some columns appear like this:
Any Thai character appears as �
While the dataset connected with PostGreSQL
I have tried
1.
libname sslib1 sqlsvr noprompt="DRIVER=SAS ACCESS to MS SQL Server;
UID=my UID ;PWD=my Password;
HOST=My host ;PORT=My port; client_encoding='UTF-8'; schema=dbo";
2. or add
proc options option=encoding;
run;
3. or create a new table
proc sql;
create table work.test(encoding='utf8') as
SELECT * FROM sslib1.mytable(encoding='utf8');
quit;
But still Thai characters appears as �
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.