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 �
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.