I need to write an export module which marks exported rows as exported. We currently run SQL Server Express 2012, but may switch to Oracle, so I need a client-side approach. We are currently using ASP.NET 4.5.
I have a boolean field named "exported" which is supposed to be set to true.
My idea was to collect all affected rows IDs in an array in the client software and build something like
Metacode:
FOREACH(affectedRowsIDs as affectedRowID)
$sql = "udpate myRows SET exported = 1 where id = $affectedRowID)
execute $sql
The problem would be a lot of queries to run.
Different thought:
FOREACH(affectedRowsIDs as affectedRowID)
$affRows += " , $affectedRowID"
$sql = "udpate myRows SET exported = 1 where id IN ($affRows)"
Could you please give me some feedback how you would do it?