Need some help Inserting data into a table

  • All, I have 26K records which I have to insert into a table. I have built a query using the Excel but I am running into an issue because there are so many lastname which contains single quote like O'Connor etc. How do I take care of this? 
    INSERT INTO TEST (FirstName, LastName) VALUES ('Thomas','L'Ecuyer ');
    INSERT INTO TEST (FirstName, LastName) VALUES ('Tyler','O'Connell ');

  • Syed Razi - Monday, November 13, 2017 10:50 AM

    All, I have 26K records which I have to insert into a table. I have built a query using the Excel but I am running into an issue because there are so many lastname which contains single quote like O'Connor etc. How do I take care of this? 
    INSERT INTO TEST (FirstName, LastName) VALUES ('Thomas','L'Ecuyer ');
    INSERT INTO TEST (FirstName, LastName) VALUES ('Tyler','O'Connell ');

    Double up the 'internal' quotes
    INSERT INTO TEST (FirstName, LastName) VALUES ('Thomas','L''Ecuyer ');
    INSERT INTO TEST (FirstName, LastName) VALUES ('Tyler','O''Connell ');

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Phil Parkin - Monday, November 13, 2017 10:53 AM

    Syed Razi - Monday, November 13, 2017 10:50 AM

    All, I have 26K records which I have to insert into a table. I have built a query using the Excel but I am running into an issue because there are so many lastname which contains single quote like O'Connor etc. How do I take care of this? 
    INSERT INTO TEST (FirstName, LastName) VALUES ('Thomas','L'Ecuyer ');
    INSERT INTO TEST (FirstName, LastName) VALUES ('Tyler','O'Connell ');

    Double up the 'internal' quotes
    INSERT INTO TEST (FirstName, LastName) VALUES ('Thomas','L''Ecuyer ');
    INSERT INTO TEST (FirstName, LastName) VALUES ('Tyler','O''Connell ');

    Thanks!

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

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