The same LIBNAME will work for updating SQL Server as well as reading, assuming you have the right database privileges.
How to connect SAS online version with Microsoft sql server ?
It is throwing this error:-
@monona wrote:
Thanks for your reply! I got error messages though.
ERROR: CLI error trying to establish connection: [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for
user ''. : [Microsoft][SQL Server Native Client 11.0]Invalid connection string attribute
ERROR: Error in the LIBNAME statement.
Does your SQL Server support trusted connections, i.e. your already authenticated network identity (when you logged in) if sufficient to grant access to SQL Server?
Do you use SQL Server Management Console, or some other tool, to connect to SQL Server outside of SAS?
Before posting more questions, you may want to invest some time here:
http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001355231.htm
If you haven't yet read this, you should...
Hello, I am trying to connect to MS SQL Server data table through SAS and I ran into this issue and not sure what it means.
I ran the following code and got issue
proc sql;
connect to SQLSVR as mydb (datasrc="SQL_SAS" user="XXX" password="XXX");
select * from connection to mydb
(select * from DATA_TABLE);
quit;
run;
23 GOPTIONS ACCESSIBLE;
24 proc sql;
25 connect to SQLSVR as mydb (datasrc="SQL_SAS" user="D113338" password=XXXXXXXXXX);
ERROR: CLI error trying to establish connection: [DataDirect][ODBC lib] Data source name not found and no default driver specified
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
26 select * from connection to mydb
27 (select * from DATA_TABLE);
ERROR: The MYDB engine cannot be found.
ERROR: A Connection to the mydb DBMS is not currently supported, or is not installed at your site.
28 quit;
I already added that SQL_SAS datasource into the ODBC Datasouce Administrator but it still did not work.
Thank you so much for any help.
@tampham92 - Adding new posts on the end of old answered posts is not a good idea. You should have started a new post, linking in the old post if necessary.
The errors suggest SAS is not finding your Data Source. Where is SAS running? Locally on your PC or remotely on a SAS server? The data source has to be defined on the computer SAS is running on. Also bitness matters. If you are running 64-bit SAS the ODBC data source has to be 64-bit.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.