Missing pound sign

RayCouzensRayCouzens Posts: 4
Hello.

I have a small problem with the generated SQL scripts converting the pound signs to a 0xDA characters when used in a DOS batch file. We have set up a DTS job which calls a couple of DOS batch files which in turn execute the SQL scripts created by DataCompare. This all works ok except in DOS the pound sign is converted and our resulting database then contains this symbol instead. I cannot see any option for the created scripts to be in DOS format. The work around is to convert the 0xDA symbol with search and replace in DOS. Would it be possible to add the option of creating the scripts in DOS format? Thank you.

Ray

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Ray,

    Thanks for your post. This sounds like it could be a Unicode problem, possibly. There are two variables at work here. One is the Unicode support of the command that you use in your batch file to run the SQL script. isql.exe does not support Unicode, but Osql.exe does. Both utilities are included with SQL Server 2000 client-side tools, so you may want to opt for the utility that supports Unicode.

    The second issue is the output format of your SQL scripts. In Data Compare 3.38 and up, there is an option in the software when you save the script where you can choose to save it as either ASCII, UTF-8, or Unicode. If there is Unicode data present in the script and you save it as ASCII, then there could be 'garbage' characters that appear in the script.

    If this information doesn't apply to the way that you are making and running these scripts, please let me know.
  • Hi Ray,

    Thanks for your post. This sounds like it could be a Unicode problem, possibly. There are two variables at work here. One is the Unicode support of the command that you use in your batch file to run the SQL script. isql.exe does not support Unicode, but Osql.exe does. Both utilities are included with SQL Server 2000 client-side tools, so you may want to opt for the utility that supports Unicode.

    The second issue is the output format of your SQL scripts. In Data Compare 3.38 and up, there is an option in the software when you save the script where you can choose to save it as either ASCII, UTF-8, or Unicode. If there is Unicode data present in the script and you save it as ASCII, then there could be 'garbage' characters that appear in the script.

    If this information doesn't apply to the way that you are making and running these scripts, please let me know.

    Thanks for the reply!

    I have been using 'osql' in my scripts so should be ok with the unicode. To use the scripts generated by DataCompare 3.38 I have been copying and pasting into Notepad and then saving as a textfile. I realise now that I should probably use the Synchronise button! Thanks for the help!
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    You'd probably want to make sure that you're saving the scripts as UTF-8 (with preamble). This option was added so that osql.exe would properly recognize the Unicode character data. Without the preamble, you get the problem that you describe. And the workaraound was (guess!) to save the script using Notepad as a UTF-8 document!

    But you don't need to do that any more if you choose the script save format as UTF-8 with preamble.
  • You'd probably want to make sure that you're saving the scripts as UTF-8 (with preamble). This option was added so that osql.exe would properly recognize the Unicode character data. Without the preamble, you get the problem that you describe. And the workaraound was (guess!) to save the script using Notepad as a UTF-8 document!

    But you don't need to do that any more if you choose the script save format as UTF-8 with preamble.

    Thanks very much for the help! I shall do this from now on.
This discussion has been closed.