Help: MS-Word apostrophes in Query Analyzer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Poster

    Help: MS-Word apostrophes in Query Analyzer

    After creating an IN clause from a bunch of character strings created by a
    Word macro, Query Analyzer complains about a syntax error. The macro takes a
    column full of character strings and wraps apostrophes (single-quotes)
    around each string and adds a comma to the end of each line, ready to paste
    into a Query Analyzer session. The problem is that Query Analyzer doesn't
    recognize the MS-Word apostrophes. It has nothing to do with the standard
    apostrophe/quote problems that some people face when dealing with embedded
    quotes.

    Can anyone suggest how to produce single-quote characters in MS-Word that
    Query Analyzer understands?

    Thank you.


  • John Bell

    #2
    Re: MS-Word apostrophes in Query Analyzer

    Hi

    If this is passed to a stored procedure then you could try the REPLACE
    function to alter the affending characters? If you want to insert the
    correct character the try Insert/Symbol from the menus and choose ascii
    character 27. You could set up a shortcut to do this.

    John

    "Poster" <Poster@hotmail .com> wrote in message
    news:40e282f3_2 @news.chariot.n et.au...[color=blue]
    > After creating an IN clause from a bunch of character strings created by a
    > Word macro, Query Analyzer complains about a syntax error. The macro takes[/color]
    a[color=blue]
    > column full of character strings and wraps apostrophes (single-quotes)
    > around each string and adds a comma to the end of each line, ready to[/color]
    paste[color=blue]
    > into a Query Analyzer session. The problem is that Query Analyzer doesn't
    > recognize the MS-Word apostrophes. It has nothing to do with the standard
    > apostrophe/quote problems that some people face when dealing with embedded
    > quotes.
    >
    > Can anyone suggest how to produce single-quote characters in MS-Word that
    > Query Analyzer understands?
    >
    > Thank you.
    >
    >[/color]


    Comment

    • Erland Sommarskog

      #3
      Re: Help: MS-Word apostrophes in Query Analyzer

      Poster (Poster@hotmail .com) writes:[color=blue]
      > After creating an IN clause from a bunch of character strings created by
      > a Word macro, Query Analyzer complains about a syntax error. The macro
      > takes a column full of character strings and wraps apostrophes
      > (single-quotes) around each string and adds a comma to the end of each
      > line, ready to paste into a Query Analyzer session. The problem is that
      > Query Analyzer doesn't recognize the MS-Word apostrophes.[/color]

      As John said, you need to run a Search/Replace somewhere to fix those
      "smart" quotes. The best place is probably in the Word macro...

      You can also tell Word not to use "smart quotes". ToolS->AutoCorrect
      and then the AutoFormat tab, uncheck '"Straight qutoes" with "smart
      quotes"'.


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

      Books Online for SQL Server SP3 at
      SQL Server 2025 redefines what's possible for enterprise data. With developer-first features and integration with analytics and AI models, SQL Server 2025 accelerates AI innovation using the data you already have.

      Comment

      Working...