Title

sql path -- Set the default remote server, database, schema

Syntax

sql path

sql path <

sql path [dsn:] [db] [.schema]

sql path [server:db] [.schema] [, driver(name)]

Description

sql path displays or sets the remote path, for odbc access to sql server. The sql path is used like the (local) current directory, to supply default location information:
When a table name is specified alone, the sql path database and schema are assumed. When a schema.table is supplied, the sql path database is assumed.

With no parameters, sql path displays the current settings, which are remembered across Stata sessions.

sql path < switches back to the prior sql path.

The parameter before the : can be either a dsn (data source name) or a server address. If a server is specified, a driver() can be specified as well;
the default driver() is listed by elfs sql.

A schema or database can be specified alone (or both together) without changing the 'higher level' settings.

A dsn can be specified with no lower level info - the default database specified when the dsn was created will be used. However, server cannot be specified without also specifying a database.

If a database is specified with no schema, a default schema (listed by elfs sql) will be used.

Examples

. sql path cdw:

. sql path adatabase.

. sql path .aschema