BookmarkSubscribeRSS Feed
Pato485
Calcite | Level 5

We tried to connect to sql server throught ODB connection, test was completed successfully. so connection is working OK:

 

Pato485_0-1712915331898.png

 

 

Pato485_1-1712915331902.png

 

 

But when we tried to connect to this database in SAS EG we got this error:

 

Pato485_2-1712915331910.png

 

 

LIBNAME IDB ODBC DATAsrc=IDB SCHEMA=dbo USER=danasova PASSWORD="xxx";

 

What we did incorrect?

 

5 REPLIES 5
LinusH
Tourmaline | Level 20

To be sure, is EG connecting to a local or a remote SAS session?

And is your ODBC Manager test done on the host where SAS executes (and using the same user/pw)?

Data never sleeps
Pato485
Calcite | Level 5

IT is local session. 2nd question - dont think so, when i tried to log through odbc driver 17 for sql server  - it worked in odbc and sas, but when we use sql server odbc connection - it doesnt.

 

This is working:

LIBNAME mylib ODBC dsn='NMI' schema=dbo;

Because it is windows auth, but when we tried it through username and password - and odbc connection sql server, it doesnt work. And we dont know why

AlanC
Barite | Level 11

Try this (with your changes):

 

libname SQLREF ODBC NOPROMPT="server=SVDSQLDCP01;driver=ODBC Driver 13 for SQL Server;trusted_connection=yes;database=DEVAPP10_Shredding" STRINGDATES=NO IGNORE_READ_ONLY_COLUMNS=YES SCHEMA=DBO; 

 

From here: GitHub - savian-net/SasTipsTricks: Tips and tricks learned over 20+ years as a SAS/Microsoft consult...

 

https://github.com/savian-net
SASKiwi
PROC Star

The SQL Server ODBC driver is really old and may not work with more recent versions of SQL Server. Try creating an IDB connection with the Version 17 driver.

Sajid01
Meteorite | Level 14

Hello @Pato485 
I see this in your post

"This is working:

LIBNAME mylib ODBC dsn='NMI' schema=dbo;

Because it is windows auth, but when we tried it through username and password - and odbc connection sql server, it doesnt work. And we dont know why"

Please check authentication mechanism defined in SQL server.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 785 views
  • 0 likes
  • 5 in conversation