INF: SQL Server Tools Save Files in OEM Format

ID: Q155233


The information in this article applies to:


SUMMARY

The Microsoft SQL Server utilities such as ISQL/w, ISQL, and the query analyzer window in the SQL Enterprise Manager save their files using the OEM code page.


MORE INFORMATION

When you run the Save or Open commands from the File menu in the ISQL/w utility or the query analyzer window of the SQL Enterprise Manager, or if you use the /i or /o switches for the ISQL command line utility, the tools will create or read the files using an OEM code page (the default OEM code page in Windows NT is the DOS 437 code page). Windows utilities assume the files they work with were created using the Windows ANSI code page (code page 1252). For additional information about code pages, please see the SQL Server Setup Guide and the following article in the Microsoft Knowledge Base:

Q153449 : INF: SQL Server Code Pages and AutoANSItoOEM Behavior

Because the SQL tools work with a different code page than other windows utilities, extended characters (those characters represented by numbers greater than a decimal 128) will not display correctly if the files are opened in a utility of the other type. For example, if you run a script in ISQL/w and save the output as a .RPT file, then open that .RPT file in Notepad, extended characters will display as characters from the other code page. If you create a file in Notepad and save it as a .SQL file and then open that .SQL file in ISQL/w, once again, any extended characters will be interpreted as the other characters. This does not apply to the standard alphabetic A-Z characters, numeric 0-9 characters, or special characters (such as @, #, $, and so forth). These are constant from one code page to another, and so always display the same character. The characters affected are the extended characters, such as German umlaut's. As an example, if you type a Spanish character in ISQL/w and the click Save from the File menu, it will be saved as OEM code 0xA5 (or decimal 165). If you then open the file in Notepad, Notepad will interpret the 0xA5 as the ANSI character for the yen sign.

The characters will be constant if you use a Windows utility that can treat a file as a DOS OEM file. For example, the Wordpad utility of Windows NT 4.0 and Windows 95 can open or save files as 'DOS Format Text Files'. These files can successfully interoperate with the SQL Server tools.


Keywords          : kbnetwork SSrvISQL 
Version           : 6.5.201
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: March 31, 1999