BookmarkSubscribeRSS Feed
StefDM
Calcite | Level 5

Dear all , 

 

I want to connect to a sql server db ( on another server ). I'm not using DSN names , the sql server db uses windows authentification.

 

Statement :

 

    libname sdmlib SQLSVR 'Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=abcde;Data Source=datasourcenameab;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=wsid;Use Encryption for Data=False;Tag with column collation when possible=False';

 

( data source name , workstation id and catalog are example values )

 

Error :

 

ERROR: Incorrect syntax for this LIBNAME statement. This engine does not accept a physical name.
ERROR: Error in the LIBNAME statement.

 

1 REPLY 1
s_lassen
Meteorite | Level 14

When you submit a statement like 

libname <name> <engine> <quoted string>;

SAS expects the quoted string to be a physical file name. What you want to do is probably something like

libname <name> <engine> <engine-option>=<quoted string>;

in your actual case something like 

   libname sdmlib SQLSVR complete='Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=abcde;Data Source=datasourcenameab;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=wsid;Use Encryption for Data=False;Tag with column collation when possible=False';

or possibly, use the PROMPT= or NOPROMPT=. The COMPLETE option display a dialog box if some options are missing; the PROMPT options always displays options in a dialog box, the NOPROMPT never displays a dialog box (but just fails if the options are not complete).

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 1306 views
  • 0 likes
  • 2 in conversation