How the DBLOAD Procedure Works
When you use the DBLOAD
procedure to create a DBMS table, the procedure issues dynamic SQL
statements to create the table and insert data from a SAS data set,
DATA step view, PROC SQL view, or view descriptor into the table.
Here are the steps that the SAS/ACCESS interface view engine completes.
Note: SAS still supports this
legacy procedure, but to access your DBMS data more directly the best
practice is to use the LIBNAME statement for your interface or the
SQL pass-through facility.
- When you supply the
connection information to PROC DBLOAD, the SAS/ACCESS interface calls
the DBMS to connect to the database.
- SAS uses the information
that the DBLOAD procedure provides to construct a SELECT * FROM table-name statement
and passes the information to the DBMS to determine whether the table
already exists. PROC DBLOAD continues only if a table with that name
does not exist unless you use the DBLOAD APPEND option.
- SAS uses the information
that the DBLOAD procedure provides to construct an SQL CREATE TABLE
statement and passes it to the DBMS.
- SAS constructs an SQL
INSERT statement for the current observation and passes it to the
DBMS. New INSERT statements are constructed and executed repeatedly
until all observations from the input SAS data set are passed to the
DBMS. Some DBMSs have a bulk-copy capability so that a group of observations
can be inserted at once. See your DBMS documentation to determine
whether your DBMS has this capability.
- Additional nonquery
SQL statements that are specified in the DBLOAD procedure are executed
as the user submitted them. The DBMS returns an error message if a
statement does not execute successfully.
- SAS closes the connection
with the DBMS.
Last updated: February 3, 2026