|
Posted by Erland Sommarskog on 10/02/71 11:56
(mollyf@hotmail.com) writes:
> Thanks Steve and Erland. That was definitely what was going on. I
> know my coworker uses Textpad and I know he generated the scripts
> through Mgmt Studio and then went back and made some changes in Textpad
> (that's what I had done myself with both Textpad and Notepad on my own
> machine and realized that something was going on whenever the file was
> edited).
>
> Of course I'm wondering why this wasn't an issue in 2000 but now it's
> an issue in 2005.
I guess it's more an issue of the tools, not the SQL Server version as
such.
The default format for saving in Mgmt Studio is Unicode, while the default
in Query Analyzer is ANSI I think. And with 8-bit chars you never run into
these sort of problems.
SQL Server Management Studio on the other hand saves in Unicode by default.
I have not experienced that Textpad thrashes the BOM, but then again I don't
use Unicode files in Textpad much. (Textpad only supports Unicode if chars
are in the ANSI set, so it's kind of useless.)
As for what happens when you open a BOM-less file, it appears that Notepad
and Textpad plays a guessing game and says "every second byte is NULL, it
must be Unicode". Guess what happens if there is some Chinese or Russian
text, so that not every second byte is 00 anymore.
Mgmt Studio refuses to open the file as soon there is a NUL character. But
guess what happens if the file has only Chinese text. The file will open,
but you will see something else.
Or you can do like Query Analyzer, which opened my BOM-less file as is.
That is, I see text like "S E L E C T "
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|