Loading...
+880 1736 699819 Mon - Sat: 9:00 AM - 8:00 PM
Follow us:
Home Blog Article
Blog

automatically generate SQL “UPDATE” statements in the last column

automatically generate SQL “UPDATE” statements in the last column

Step 1: Open Your Excel File

Suppose your Excel has this structure:

EmpCodeName...(empty column for SQL)

L58882 | Mahmudul Hasan |  | 
L54459 | Emon |  | 

excel.png 66.42 KB
Step 2: Add SQL Formula in Last Column

In the first row of the last column (say column D), enter this formula:

="UPDATE EMPLOYER SET Hold = 'N' WHERE EmpCode = '" & A2 & "';"

👉 Explanation:

  • A2 = the cell where your EmpCode is located
  • Adjust the column letter (A) depending on your Excel layout

Step 3: Apply to All Rows


After entering the formula in the first row:

  • Hover over the bottom-right corner of the cell (you’ll see a + sign)
  • Double-click the fill handle → Excel will auto-fill all rows

Step 4: Copy & Paste as Text (Optional)


If you need to use these queries elsewhere:

  1. Copy the last column
  2. Paste as Values (Right-click → Paste Special → Values)
  3. Save as .sql or .txt file if needed


Tags: Blog
Share this post

Encoderbase Team

Author

Articles and insights from the Encoderbase editorial team covering web development, software engineering, and digital solutions.

Enjoyed this article?

Get more articles like this delivered to your inbox — no spam, unsubscribe any time.

Link copied to clipboard!