I have two tables in SQL Server 2005: ImagesMain and ImagesNew. They have the same structure:
ImagesMain is a listing of all images on a server.
ImagesNew contains a listing of a subset of the images on the server. It contains:
-Items that exists in the main table
-Items that exists in the main table but has changed since the last update
-New items that don't exist in the main table
I'd like to update the main table in the following manner:
Any tips on how I could accomplish this? Cursors?
/Christian
Code:
FILENAME WIDTH HEIGHT LASTMODIFIED 00328.JPG 757 275 2007-05-08 09:40:25 01_806.jpg 567 423 2007-10-03 10:16:57
ImagesNew contains a listing of a subset of the images on the server. It contains:
-Items that exists in the main table
-Items that exists in the main table but has changed since the last update
-New items that don't exist in the main table
I'd like to update the main table in the following manner:
Code:
If row exists with current filename if new date > old date update row else insert row
/Christian
Comment