Hi There,
I have been trying all weekend to do this but can't.
I have a .csv file with 1 column / field that contains a number.
For each row in the csv I need use the number to get the corresponding record in a table called WorksReq.
Once I have the WorksReq record I need to get around 4 field values and use those value to add a record to a table called PartsReq.
Could someone please help me to do that.
I think djj55 is probably onto the right path here.
I would personally import the file into a holding table in the database (call it import for want of a better name), then you can simply query the database tables against the import table to get the results you need. Just remember to empty the import table at the beginning of each new import to ensure you only query for the results you want.
Restore a backup to a new, temporary, database name.
IF (hopefully!!) your database is in Full Recovery Model and you have LOG backups, then use those to restore to point-in-time just/shortly before the data was "lost"
"Copy" the missing rows (or columns, within rows) back to the live database (i.e. use INSERT and/or UPDATE and join the tables in TEMP and Live databases)