I went through great pains to add a primary key to my SQL table so that Patch() and Collect() would work properly. I also wish to use Update(). Its just a cleaner way to update an entire record in one go. However, Since the table now has an automatic key, I cant make it go. If I leave my key column out of my Set() variable, then the command failes because the column is missing. If I add the column, even if Blank(), it returns: "The specified column is generated by the server and can't be specified." So, its a Darned if you do, darned if you don't scenario. I guess Update() is just not applicable with a table with a index??
BTW, Collect() works in a similar fashion. It works fine. I guess adding a new row to the table is not affected in the same way.
There are a few functions to help update a table: Update, UpdateIf, and Patch.
UpdateIf and Patch do not require you to replace the entire row with another full row, so they would be the functions to use in this case.
The Update function requires you to replace an entire row with another full row. But as you have found out, if you have a column whose values must be unique (and it's identity is auto-generated), then this will not work.
Here's the doc in question:
Use the Update function to replace an entire record in a data source. In contrast, the UpdateIf and the Patch functions modify one or more values in a record, leaving the other values alone.
For a collection, the entire record must match. Collections allow duplicate records, so multiple records might match. You can use the All argument to update all copies of a record; otherwise, only one copy of the record is updated.
If the data source generates a column's value automatically, the value of that column must be reaffirmed.
PS: I've found Patch does NOT work for Collections of items from Sharepoint lists, @RandyHayes (I think) aimed me at UpdateIf to Patch Collections from SP lists. After reading @Mr-Dang-MSFT 's comment above RE: unique items, I think I now know WHY!