ShaunK ShaunK - 13 days ago 9
SQL Question

How would I use excel to generate a large update sql statement?

I know there's a way to have insert statements within excel. Is there one for update? so far I've managed to come up with my update statement in SQL, but I have 6000 rows to update:


= "Update table Set name = " & A1 & " Where namefk = " & E2 & ""


Basically, I want the name and namefk to be populated with fields in my excel..but I can't seem to get it right. Any help will be appreciated.

Answer
= "update table set name = '" & B1 & "' where namefk = '" & A1 & "'"

where column A1 has name fk & B1 have name You can drag the formula to achieve query to update thousands of records :) You can look into the link with the Example excel Hope it helps