473,408 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

isql / osql / Windows XP / disable "Automatic ANSI to OEM conversion"

Hello to all SQL Server junkies who work with non-English characters:

For people running scripts from the command line using ANSI files with
special characters, it is very important to use isql and disable
"Automatic ANSI to OEM conversion":
- This only affects isql from the command line, and no gui
applications
- http://support.microsoft.com/?scid=kb;EN-US;153449
- Start the "Client Network Utility"
C:\WINDOWS\system32\cliconfg.exe
- Select the DB-Library Tab
- Deselect "Automatic ANSI to OEM conversion"
- Click OK or Apply

Or inject this registry entry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\ Client\DB-Lib]
"AutoAnsiToOem"="OFF"

Here are some useful lines from a batch script to query the current
value of the registry and reset if necessary. This is tested on
Windows XP. It will query the registry, throw away the first three
lines of output, and return the value of the third field on the fourth
line. Delims lists one tab character and one space character. Type the
following all on one line:

@FOR /F "SKIP=3 TOKENS=3 DELIMS= " %%A IN ('REG QUERY
HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib /v AutoAnsiToOem') DO
@SET AUTOANSITOOEM=%%A

Type the "reg add" line all on one line:

@IF /i "%AUTOANSITOOEM%" EQU "ON" (
@ECHO
************************************************** **********************
@ECHO ****
@ECHO **** We need to disable "Automatic ANSI to OEM conversion"
@ECHO **** Please see
http://support.microsoft.com/?scid=kb;EN-US;153449
@ECHO **** This only affects isql from the command line
@ECHO ****
@ECHO
************************************************** **********************
@REM
REG ADD HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib /v
AutoAnsiToOem /t REG_SZ /d OFF
)

Alternatively, you must use Unicode script files and osql.

PS: Thank you to Erland Sommarskog for http://www.sommarskog.se and Rob
van der Woude for http://www.robvanderwoude.com

Jan 13 '06 #1
1 11213
Within the FOR command use SKIP=2 on Windows Server 2003

Philip Bondi wrote:
Hello to all SQL Server junkies who work with non-English characters:

For people running scripts from the command line using ANSI files with
special characters, it is very important to use isql and disable
"Automatic ANSI to OEM conversion":
- This only affects isql from the command line, and no gui
applications
- http://support.microsoft.com/?scid=kb;EN-US;153449
- Start the "Client Network Utility"
C:\WINDOWS\system32\cliconfg.exe
- Select the DB-Library Tab
- Deselect "Automatic ANSI to OEM conversion"
- Click OK or Apply

Or inject this registry entry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\ Client\DB-Lib]
"AutoAnsiToOem"="OFF"

Here are some useful lines from a batch script to query the current
value of the registry and reset if necessary. This is tested on
Windows XP. It will query the registry, throw away the first three
lines of output, and return the value of the third field on the fourth
line. Delims lists one tab character and one space character. Type the
following all on one line:

@FOR /F "SKIP=3 TOKENS=3 DELIMS= " %%A IN ('REG QUERY
HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib /v AutoAnsiToOem') DO
@SET AUTOANSITOOEM=%%A

Type the "reg add" line all on one line:

@IF /i "%AUTOANSITOOEM%" EQU "ON" (
@ECHO
************************************************** **********************
@ECHO ****
@ECHO **** We need to disable "Automatic ANSI to OEM conversion"
@ECHO **** Please see
http://support.microsoft.com/?scid=kb;EN-US;153449
@ECHO **** This only affects isql from the command line
@ECHO ****
@ECHO
************************************************** **********************
@REM
REG ADD HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\DB-Lib /v
AutoAnsiToOem /t REG_SZ /d OFF
)

Alternatively, you must use Unicode script files and osql.

PS: Thank you to Erland Sommarskog for http://www.sommarskog.se and Rob
van der Woude for http://www.robvanderwoude.com


Jan 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Miki Tebeka | last post by:
Hello All, I'm shipping an application using py2exe. With Python2.3 it worked fine but when switching to Python2.4 I started getting "warning: string/unicode conversion" all over the place. ...
4
by: Luke Wu | last post by:
I am just wondering what the following terms usually mean: 1) "Standard C" 2) "K&R C" 3) "ANSI C" I am pretty sure "ANSI C" usually refers to the C89 standard, but what
8
by: Dgates | last post by:
Has anyone typed up an index for the O'Reilly book "C# and VB.NET Conversion?" I'm just learning C#, and often using this little book to see which VB.NET terms translate directly to some term in...
7
by: Johann Blake | last post by:
It would be nice to have Visual Studio .NET automatically break into the code whenever an event is generated without having to explicity set a breakpoint. It often happens that when a piece of code...
2
by: George Durzi | last post by:
Hey folks, I just installed VS .NET 2003 on top of Windows 2003 Server. I was opening a Web Project from source control, and got a warning that the project would have to be "converted", and that I...
5
by: Hayato Iriumi | last post by:
When converting a type to another using CType and if the type conversion fails, it throw an exception. However, in C#, there is a keyword "as" which only makes the variable Nothing (null) without...
4
by: Philip Nelson | last post by:
Folks, I've got a database and tablespaces "managed by automatic storage". I've deleted a lot of data from some tables. I've then reorged them. But the tablespaces don't appear to shrink...
8
by: Simon Klein | last post by:
Hi, I've got a problem. I wrote a Program with a Signalhandler Routine. If i use the compile flags "-ansi -pedantic -Wall", "(void) signal(SIGCHLD,Handler)" catches the first signal but ignores...
2
by: paragdi | last post by:
Hi Experts! I am developing heavy mathematical engineering windows application in VB.NET (VS2005) with MSAccess Db. This application has resource files in English, Spanish and German Language. I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.