Wednesday, September 3, 2014

Changing the SAS data to be SQL

Changing the SAS data to be SQL - A SAS data base allows you to create reports and display statistical data for companies. The Microsoft SQL Server has a function linked server that lets you access a SAS server and export the data base SAS data to Microsoft SQL Server. A linked server can be accessed directly from the Server Management Studio SQL software, so you can send data from SAS to SQL from one location.

Instructions

1. Open SQL Server Management Studio from the group "SQL Server" program in the Windows menu. Log into the database server to which you want to import SAS data.

2. Click the icon "Linked Server" in the properties of the database tree in the left pane. Click "New" and then "Linked Server". A configuration window opens.

3. Select the OLE server SAS controller in the dropdown menu. For example, if your database contains SAS data using the MS SQL engine, select "MS SQL" drop-down menu. Enter your username and password and the name of the database for the SAS base. Click "OK" to create the connection.

4. Export data from your SAS server to the MS SQL server. The following code uses the SQL "Select in" option to retrieve the data from the "orders" table from a SAS server and push it to the MS SQL server: select into imported_orders (select * from sas.database.orders) Replaces "sas" with the name of the SAS server and replace "database" with the name of the SAS database from which you want to import the data.