I have recently imported some data to SQL for a client, using files provided by another company. We made edits in Excel, using different vlookups and concatenates, and have now realized that one field called ShortFileName is not correct. The table (File) with the incorrect ShortFileName data has other relational tables that point to it (People2File, Notes2File, etc), so we need to leave the data there, with the unique identifiers staying the same, but update the data in the ShortFileName column. What I want to do is: correct the excel file, import it into a new table called 'File2', use another column called 'MatterId' to cross reference tables 'File' and 'File2', and update the 'File' table's ShortFileName column with the data from 'File2's ShortFileName.
Here is what I have come up with, but I havent tried it yet, and I am not sure the syntax is correct. This is probably the most advanced SQL query I have attempted.
UPDATE File
Set ShortFileName = File2.ShortFileName
From File
Inner Join File2
ON File.MatterID = File2.MatterID
It's important that the query is smart enough to match the rows on each table, find the match and return the ShortFileName from that row only, updating the real File table with the data from the new File2 table (which I am importing simply to be able to do the lookup using the Join statement).
If there is another way, even using SQL's import wizard, and avoiding creating the new table, please let me know.
Thanks in advance...