Is there a way to set or update a node's NID?
I receive a CSV file that gets generated every month with a list of content that exists in a seperate database. Unfortunately, the CSV file lists all the content in the old database every time (and I can't change that).
So now I am stuck with a problem: is there any way to know if a certain piece of content has already been imported? It would be nice if I could use the old content IDs that are in the CSV file as the NID of the node, but I haven't been able to find a way to set or update the NID of a node.
I've thought about putting the old ID in a CCK field, but I don't know of a way to search for a node by CCK Field value in PHP.
Does anyone know how to either set/update a node's NID or search by CCK field value in php to return a node?
Thank you in advance.

After some reading and
After some reading and playing with code I figured out a way to do this:
<?php$field = content_fields('field_legacy_id');
$db_info = content_database_info($field);
//see if the node alreay exists
$query = "SELECT n.nid FROM {node} n INNER JOIN {". $db_info['table'] ."} a ON a.vid = n.vid WHERE a.field_legacy_id_value = $legacyID";
$result = db_query($query);
$exist = db_fetch_object($result);
if ($exist != NULL) $node->nid = $exist->nid;
?>
I hope this helps someone down the road!