Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sta64
Starting Member
1 Post |
Posted - 2004-05-20 : 09:49:36
|
Hi guys,I'm developing a large script for MS-SQL 7.0 that can script objects: create a SQL script that creates, drops objects, inserts data into them etc. (Later, MS-SQL 2000 compatibility will also be added but I'm running MS-SQL 7.0 on my own machine at my work place... And, yes, Enterprise Manager can also do that but that script generator is buggy and it can't decrypt encrypted views and stored procedures either!)The script generator script is already working quite nicely (drop me an E-mail, if you're interested, I haven;'t published it on my homepage yet) but, of course, non-interactive execution (i.e. outside SQL Query Analyzer) is preferred when being used in an automated environment. For this, there's osql, provided by Microsoft. My current problem is that osql converts (Hungarian) national characters from the ANSI code page of the database (CP1250) to the OEM code page (CP852). Thus, the resulting scripts create different stored procedures and insert different data into tables: the national characters in error messages and in string fields are not the same anymore... After having given up trying to find _detailed_ information about osql in SQL Books Online, my web research showed that there's no option in osql that would let the user disable the code page conversion completely. I even tried to hack the binary osql executable, but that was in vain: it still converts characters, dammit!I understand that MS-SQL 2000's osql provides the -D switch, through which an already defined ODBC data source, in which character conversion is disabled, can be accessed. However, betcha, we're not gonna upgrade our several hundred MS-SQL 7.0 licences for this stupid reason...!I was also thinking of piping the output file through a CP852->CP1250 code page converter but that wouldn't be general enough (helping only with Central and Eastern European national characters) and, _if_ I made a more general one, some characters may still be lost during the ANSI->OEM->ANSI conversion...If any of you have some idea on what to do, I'd appreciate a reply very much. Thank you for your help in advance,JoeJoe Forster/STAsta@c64.org |
|
|
|
|
|
|
|