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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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