DATA Step, Macro, Functions and more

Read data from SQL server

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

Read data from SQL server

How can I directly import data from SQL server to SAS? Is there sample code? Thank you!


Accepted Solutions
Solution
‎07-31-2017 04:35 PM
PROC Star
Posts: 325

Re: Read data from SQL server

Posted in reply to Jerrynetwork

you can do this by defining libname as shown below or by doing explicit pass through

LIBNAME SQL ODBC DSN=’sql server’ user=sasjlb pw=pwd;

 

Below two papers will be to give lot of info on this

https://support.sas.com/techsup/technote/ts765.pdf

http://analytics.ncsu.edu/sesug/2002/DM10.pdf

 

View solution in original post


All Replies
Super User
Posts: 19,770

Re: Read data from SQL server

Posted in reply to Jerrynetwork

First you need to connect to SQL and that depends on your system set up. 

Contributor
Posts: 22

Re: Read data from SQL server

Thank you for response!

Solution
‎07-31-2017 04:35 PM
PROC Star
Posts: 325

Re: Read data from SQL server

Posted in reply to Jerrynetwork

you can do this by defining libname as shown below or by doing explicit pass through

LIBNAME SQL ODBC DSN=’sql server’ user=sasjlb pw=pwd;

 

Below two papers will be to give lot of info on this

https://support.sas.com/techsup/technote/ts765.pdf

http://analytics.ncsu.edu/sesug/2002/DM10.pdf

 

Contributor
Posts: 22

Re: Read data from SQL server

Thank you!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 175 views
  • 2 likes
  • 3 in conversation