Skip to main content

Hi,

I need to insert data in sql server from excel data.

 Excel rows data having single quote in between values. because of that it is not update in sql server.

can anyone help on this.

 

Thanks

Please share some sample, anonymized data here and we might have a better idea of how to help.


Hi ​@Aaron.Gleason ,

Please find the attachement.

 


@babu 3365 Perfect. Thank you!

The data you’re showing has items like Sai’s and Paul’s. When using these in SQL commands that also use apostrophes to enclose strings, this is causing a problem.

insert into users (lastname, firstname, id) values ('Babu', 'Sai's', 123234);

One way to perfect the data before inserting into the database is to replace the apostrophes with two apostrophes with something like the String: Replace action:

Since you’re reading from an Excel file, you can replace the Source string with your record variable, e.g., $rExcelRow{“First Name”}$

This should prevent your SQL command from not working due to apostrophes. This will need to be done on any column that would potentially contain an apostrophe.


Thanks ​@Aaron.Gleason 

I will check this scenario.


Reply