The webguys wants unique urls based on the name of the products If more products have the same name, add a number after the name.
our.dom/red-sock
our.dom/red-sock-1
They do not want the product id or another number on all products, i.e.
our.dom/red-sock-123481354
I store this in a field i call seourl.
I have it covered when I create new products, a trigger tries adding the seourl, if it is already there, increment the number, until an unique value is found.
But I now have to give the entire table new seourls. If I just
update tab set seourl=dbo.createurl(title)
I am sure to have collissions, and the operation is rolled back. Is there a way to have the statement to commit the updates that work, and leave the rest unchanged?
Or must I just do a RBAR, Row By Agonizing Row operation in a loop?
Adapt this to your needs: