Sample 31625: Using SAS/ACCESS® Interface to Microsoft SQL Server and SAS/ACCESS® Interface to Sybase to perform the same function as Oracle’s DESCRIBE command
Overview
This sample provides a program that enables you to use SAS/ACCESS Interface to Microsoft SQL Server and SAS/ACCESS Interface to Sybase to perform the same function as Oracle’s DESCRIBE command.
You can substitute the following parameters in the parentheses in the SELECT statement to find different table attributes:
- SP_COLUMNS TABLE_NAME: Lists column names and attributes.
- SP_HELP TABLE_NAME: Lists tables with column names.
- SP_HELP TABLES@TABLE_OWNER='owner-id': Lists tables in the database with the user ID.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
You need to enter values for the user ID and the password. Depending on the SAS engine that you are using, you also need to enter the correct value or values for one of the following:
- the DSN= parameter (for the ODBC and SQLServer engines)
- the SERVER= (for the Sybase engine) and the DATABASE= parameters (for the Oracle database)
/* Use this code if you have SAS/ACCESS® Interface to MS SQL Server. */
proc sql;
connect to sqlsvr(uid=user-id pwd=password dsn=data-source-name);
select * from connection to sqlsvr( sp_columns table_name);
disconnect from sqlsvr;
quit;
/* Use this code if you have SAS/ACCESS® Interface to Sybase. */
proc sql;
connect to sybase(uid=user-id pwd=password server=server-name database=database-name);
select * from connection to sybase( sp_columns table_name);
disconnect from sybase;
quit;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This program explains how to use SAS/ACCESS software to list table attributes from the Sybase and the Microsoft SQL Server databases.
| Date Modified: | 2008-09-15 10:54:35 |
| Date Created: | 2008-03-28 16:52:29 |
Operating System and Release Information
| SAS System | SAS/ACCESS Interface to Microsoft SQL Server | 64-bit Enabled AIX | 9.1 TS1M3 SP4 | |
| 64-bit Enabled HP-UX | 9.1 TS1M3 SP4 | |
| 64-bit Enabled Solaris | 9.1 TS1M3 SP4 | |
| HP-UX IPF | 9.1 TS1M3 SP4 | |
| Linux on Itanium | 9.1 TS1M3 SP4 | |