Tuesday, 18 July 2017

Generate INSERT INTO statement From EXCEL

Scenario:

              Here, I have to generate an INSERT INTO Statement From Excel Using Formula.

Example:

From the above sheet, I’m going to create insert into statement.
Enter the following formula in a formula bar in an empty cell on the same sheet.

Formula:

 ="INSERT INTO tablename VALUES ("&a2&",'"&b2&"');"
It will generate an Insert into statement



We can drag it to wherever it depends on the available data.



Note:
For a string, we should use single quotes.
i.e., ‘ “ &b2&” ‘

Thank you for visiting my Blog...

Share Your Comments…




No comments:

Post a Comment