Hi,
I have SAS 9.4 and SQL(2008) application in my PC.My entire database are in SQL application.
I want to use SQL database in SAS. There i found some code for connectivity in internet but those are not effective.
Can any one please suggest the perfect code with an example for me to proceed further.
Libname New_lib ODBC NoPrompt="Driver=C:; Server=192.168.1.14; Database=Mvdsc1302; Uid=IT; pwd=***";
ERROR: CLI error trying to establish connection: [Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
ERROR: Error in the LIBNAME statement.
ERROR: CLI error trying to establish connection: [Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
ERROR: Error in the LIBNAME statement.
How/what should i insert in Driver filed, Please help me with correct format.
Open the Windows ODBC Administrator tool and select the Drivers tab to find out the names of the ODBC drivers you have installed. As I suspect you are using SQL Server the likely driver name is SQL Server.
Libname New_lib ODBC NoPrompt="Driver=SQL Server;Server=192.168.1.14;Database=Mvdsc1302;Uid=IT;pwd=***";
Forgetting SAS as the client application for the time being, let's first ensure the underlying SQL database client can connect to the SQL database server - because without that, any client applications will fail to connect.
So:
Good luck!
Thanks for your suggestion.
You guys are really awesome!. @AndrewHowell @SASKiwi
& The code works GREAT!...
Got all the tables from SQL.
Open the Windows ODBC Administrator tool and select the Drivers tab to find out the names of the ODBC drivers you have installed. As I suspect you are using SQL Server the likely driver name is SQL Server.
Libname New_lib ODBC NoPrompt="Driver=SQL Server;Server=192.168.1.14;Database=Mvdsc1302;Uid=IT;pwd=***";
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.