text with ' character

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

    text with ' character

    Hi,

    How do I insert text that contains the ' character into a text column?
    I'm getting an Incorrect syntax error.
  • Simon Hayes

    #2
    Re: text with ' character


    "Hyrum Mortensen" <hymort@hotmail .com> wrote in message
    news:286d1c4c.0 402191015.611c7 d9f@posting.goo gle.com...[color=blue]
    > Hi,
    >
    > How do I insert text that contains the ' character into a text column?
    > I'm getting an Incorrect syntax error.[/color]

    You have to use two quotes:

    insert into dbo.MyTable (MyColumn) values ('O''Reilly')

    See "Using char and varchar Data" in Books Online.

    Simon


    Comment

    Working...