Previous Page | Next Page

The SQL Procedure


Retrieves and uses DBMS data in a PROC SQL query or view.
Tip: You can use CONNECTION TO in the SELECT statement's FROM clause as part of the from-list.
See also:

Connecting to a DBMS Using the SQL Procedure Pass-Through Facility in the SAS 9.2 SQL Procedure User's Guide

SAS/ACCESS documentation

CONNECTION TO dbms-name (dbms-query)
CONNECTION TO alias (dbms-query)



specifies an alias, if one was defined in the CONNECT statement.


identifies the DBMS that you are using.


specifies the query to send to a DBMS. The query uses the DBMS's dynamic SQL. You can use any SQL syntax that the DBMS understands, even if that syntax is not valid for PROC SQL. For example, your DBMS query can contain a semicolon.

The DBMS determines the number of tables that you can join with dbms-query. Each CONNECTION TO component counts as one table toward the 256-table PROC SQL limit for joins.

See SAS/ACCESS for Relational Databases: Reference for more information about DBMS queries.

Previous Page | Next Page | Top of Page