SQL Server 2005 Opening Script File Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mollyf@hotmail.com

    #16
    Re: SQL Server 2005 Opening Script File Problem


    Erland Sommarskog wrote:
    <snip>
    In SQL Server 2000, I could generate scripts in Enterprise Manager and
    then open them up in Textpad or Notepad and make changes if I needed
    to, then go and open the file in Query Analzyer and run it without a
    problem--having to deal with Unicode was never an issue. I should have
    phrased my question better to make it more along the lines of why
    Microsoft changed the default setting, etc. the way that they did.
    I'll resist answering my question with a sarcastic answer:-)

    What books would you recommend for someone transitioning from 2000 to
    2005? Back in 2000, I bought the book "Profession al SQL Server 7.0
    Programming" by Rob Vieira and used that to teach myself SQL Server 7
    (I had never used it before prior to the year 2000 and never took a
    training class for it) and that book has been a great reference book
    through the years for my coworkers and me but from looking at Amazon,
    the 2005 version of his book won't be released until November and I'm
    needing to learn about the differences now. Not only with programming
    but with some of the DBA tasks (I'm not a DBA but I do some of the DBA
    stuff). Preferably a book not released by Microsoft Press:-)

    Thanks.

    Molly J. Fagan

    Comment

    • Steve Kass

      #17
      Re: SQL Server 2005 Opening Script File Problem

      I'm not sure this kind of thing is going to show up in a typical
      book. Depending on what you do in 2000 that needs to be done in
      2005, monitoring this newsgroup and the .tools and .programming
      ones within microsoft.publi c.sqlserver.* hierarchy isn't a bad
      start. There may be good books out for what you want, too - browse
      around.

      SK

      mollyf@hotmail. com wrote:
      Erland Sommarskog wrote:
      <snip>
      In SQL Server 2000, I could generate scripts in Enterprise Manager and
      then open them up in Textpad or Notepad and make changes if I needed
      to, then go and open the file in Query Analzyer and run it without a
      problem--having to deal with Unicode was never an issue. I should have
      phrased my question better to make it more along the lines of why
      Microsoft changed the default setting, etc. the way that they did.
      I'll resist answering my question with a sarcastic answer:-)
      >
      What books would you recommend for someone transitioning from 2000 to
      2005? Back in 2000, I bought the book "Profession al SQL Server 7.0
      Programming" by Rob Vieira and used that to teach myself SQL Server 7
      (I had never used it before prior to the year 2000 and never took a
      training class for it) and that book has been a great reference book
      through the years for my coworkers and me but from looking at Amazon,
      the 2005 version of his book won't be released until November and I'm
      needing to learn about the differences now. Not only with programming
      but with some of the DBA tasks (I'm not a DBA but I do some of the DBA
      stuff). Preferably a book not released by Microsoft Press:-)
      >
      Thanks.
      >
      Molly J. Fagan
      >

      Comment

      • Steve Kass

        #18
        Re: SQL Server 2005 Opening Script File Problem

        Meaningful Chinese files are likely to have some newlines that contain
        0x00 bytes.

        I removed the BOM from

        空山不見人 ,
        返景入深林 ,
        但聞人語響 。
        復照青苔上 。

        But perhaps because of the 0x00's remaining in the newlines,
        Notepad again took over. However, it this case, notepad displayed
        garbage:

        zzq\
        N媺篘 

        詮ofeQ駇梘 

        FO^€篘瀶 ?0

        gqR椩?N0


        SK


        Erland Sommarskog wrote:
        (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 "
        >

        Comment

        • Erland Sommarskog

          #19
          Re: SQL Server 2005 Opening Script File Problem

          (mollyf@hotmail .com) writes:
          In SQL Server 2000, I could generate scripts in Enterprise Manager and
          then open them up in Textpad or Notepad and make changes if I needed
          to, then go and open the file in Query Analzyer and run it without a
          problem--having to deal with Unicode was never an issue. I should have
          phrased my question better to make it more along the lines of why
          Microsoft changed the default setting, etc. the way that they did.
          There is no reason to blame Microsoft for third-party product throwing
          away the byte-order mark. Least of all third-party products with only
          a half-hearted Unicode support like Textpad.


          --
          Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

          Books Online for SQL Server 2005 at

          Books Online for SQL Server 2000 at

          Comment

          Working...