Results 1 to 2 of 2

Thread: SQL Select of a name with ' in text

  1. #1
    Justin Kerby Guest

    SQL Select of a name with ' in text

    This may seem easy for some but how do you sql select from a table a name with ' included. e.g. select everyone with the surname O'Brian

    At the moment I am using Select * From Employees where [surname] = " xsurname " wher xsurname has the name.

  2. #2
    Chris Guest

    SQL Select of a name with ' in text (reply)


    SELECT * FROM Employees WHERE [SurName] = 'O''Brian'

    OR

    DECLARE @name varchar(20)
    SET @Name = 'O''Brian'
    SELECT @NAme
    SELECT * FROM Employees WHERE [SurName] = @Name

    ------------
    Justin Kerby at 9/22/00 7:14:16 AM

    This may seem easy for some but how do you sql select from a table a name with ' included. e.g. select everyone with the surname O'Brian

    At the moment I am using Select * From Employees where [surname] = " xsurname " wher xsurname has the name.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •