## INF: Handling sp_server_info Language Events in ODS Apps

Q117859

The information in this article applies to:

- Microsoft SQL Server version 4.2x

## SUMMARY

Microsoft SQL Server DB-Library (DB-Lib) clients use ANSI-to-OEM conversion if the DB-Library option DBANSItoOEM is set using dbsetopt() or if the "Automatic Ansi to OEM" option is set using the Client Configuration Utility. When connecting, a DB-Library client using ANSI-to-OEM conversion determines which character set is in use at the server by issuing the query "exec sp_server_info 18" against the server.
SQL Server for Windows NT uses DB-Library to issue RPC requests to remote servers. Thus, if the "Automatic Ansi to OEM" option is set on the computer running SQL Server for Windows NT, the SQL Server (as the DB-Library client) issues the "exec sp_server_info 18" language request when issuing an RPC to a remote server. This can cause unexpected language events to be triggered in Open Data Services (ODS) servers accepting RPC requests from NT SQL Servers.

## MORE INFORMATION

If the ODS server is configured to accept language events, the "exec sp_server_info 18" language request can be safely ignored by using the following code fragment:

       #define SERVER_INFO_QUERY   "exec sp_server_info 18"
       query = srv_langptr(srvproc);

       if (!strncmp(query, SERVER_INFO_QUERY, strlen(SERVER_INFO_QUERY)))

               srv_senddone(srvproc, SRV_DONE_FINAL, 0, 0);
       }

This causes the DB-Library client to perform data conversions under the assumption that the ODS server is NOT using the ANSI codepage.
In order to keep this query from being sent by SQL Server for Windows NT and other Windows NT DB-Library applications, start the SQL Client Configuration Utility and ensure that the "Automatic Ansi to OEM" checkbox is cleared.

Additional query words: Windows NT oemtoansi ansitooem

Keywords : kbinterop kbtool
Issue type :
Technology : kbSQLServSearch kbAudDeveloper kbSQLServ420OS2

Last Reviewed: March 21, 1999 © 2001 Microsoft Corporation. All rights reserved. Terms of Use.