sp_enumdsn (version 6.5)

Reports all defined ODBC DSNs for a server running under a specific Windows NT user account.

Syntax

sp_enumdsn

Remarks

Every SQL Server service has a user context. A user context is a set of Registry entries that includes the definitions of the ODBC data sources for the user. The user context is provided by the username under which the SQL Server is running.

For example, if the server is running under the system account user context, the DSNs that are returned will all be system DSNs that are associated with the system account. If the server is running under a private user account, only the DSNs defined for that user's private account are returned.

A two-column result set is returned with the DSN name and description.

Example

This example returns all the defined ODBC DSNs for a server running under a specific Windows NT user account.

sp_enumdsn

Data Source Name       Description
-----------------------------------------------------
northwind             Microsoft Access Driver (*.mdb)
sql_pubs                  SQL Server
  

Permission

Only the system administrator can execute this procedure.