Reply to Re: SQL Server 2005 Opening Script File Problem

Your name:

Reply:


Posted by Erland Sommarskog on 08/22/06 20:25

(mollyf@hotmail.com) writes:
> I tried opening the file with an XML editor but got the parameter is
> incorrect error message (it's not an XML file so I wasn't surprised).
> I was able to open it with the various encoding editors--of course it
> appeared as all garbage in the editor since it's a plain text file but
> any other type of editor, I got the same error message ("The file could
> not be opened with the selected editor. Please choose another
> editor.")
>
> I appreciate your trying to help me with this.

OK, I think I have the answer: there is probably a NUL character in
the file. Or many of them. (NUL character the value of char(0).)

Two possibilities: 1) Someone actually entered a NUL character in it
at will. 2) The file was saved as Unicode file, but without any byte-
order mark. Unicode files usually have a byte-orde mark (BOM) their first
two bytes, so that programs that read the file can tell whether the high or
low bytes come first. Mgmt Studio appear to interpret the absesnce of
byte-order marks as if the file in an 8-bit character set. I produced
a Unicode file without BOM, and indeed the file opened in Notepad -
which displayed it correctly.

You can verify my theory with a hex viewer. If you don't have one,
go to www.textpad.com and download Textpad, a shareware editor. Open
the file and in the File Format box, select Binary. If my theory is
correct every second byte will read 00.

--
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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация