Hello,
I am wondering if there is any other way to export sas dataset to ms sql server other than sas_dataset>csv>ms sql dataset manually.
I connected to the MS sql server through
libname ABC odbc noprompt = "server=SQLSVR;driver=SQL server native client 11.0;
Trusted_connection=yes" database=mydatabase schema=dbo;
However, i haven't understood how this works.
I would appreciate any recommendations/tips regarding this problem.
A couple of suggestions:
Use SAS to load a temporary SQL Server table which is then used by the SQL Server load process.
Write a delimited file from SAS then get the SQL Server load process to read the delimited file
us the update statement in you datastep or sql statement.
What do you mean by "manually"? Once you've defined the library connecting to the data base you can use it like any other libref.
Code like below would append data from sashelp.class to a table class on your server. It even would create the table in the database if it doesn't exist already.
proc append base=abc.class data=sashelp.class;
run;
The SAS/Access to ODBC documentation will provide you with much more detail.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: