Thankfully a co-worker stopped me and suggested that I use formulas in Excel. "Huh?" I said to him. After giving me a look that said very clearly said "how could you not know this," he explained that if the data in the spreadsheet is correctly separated in to cell, you can use a little formula magic to write all of your SQL statements for you. For example if you have your primary key in A and data to update in M your formula might look like this:
="UPDATE tableName SET fieldName = '" & M2 &"' WHERE primaryKey = " & A2
Then copy the formula and paste way to create an update statement pre row, which can be copied in to your db tool of choice or a CF file. Now I may, in fact, be the last developer to learn about this, but I had to share, in case there were other lost souls like me out there. ;-)
No comments:
Post a Comment