Inserting special Characters

  • How do i insert the special character "'" into a table field in a T-SQL INSERT command.

    Ex: INSERT INTO TABLE (FIELD) VALUES('?')

  • try this:

    INSERT INTO TABLE (FIELD) VALUES('''')

    Robert Marda

    SQL Server will deliver its data any way you want it

    when you give your SQL Programmer enough developing time.

    Robert W. Marda
    Billing and OSS Specialist - SQL Programmer
    MCL Systems

  • You can also use the ascii value of the character, as in char(39) for a single quote character.

    Steve Armistead,

    Database Administration

    Panther Systems Northwest, Inc.

    Vancouver, WA

    Steve

  • The key to output a single quote is put two single quotes in the input such as ' would be submitted as '''' and '' single quotes submitted as ''''''.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply