How to update a UID throughout the database? Our database makes use of uniqueidentifier and we have the need to update that value everywhere it's found in our system.
Sample minimal structure:
CREATE TABLE Users
(
    id uniqueidentifier not null default newsequentialid() primary key,
    [name] nvarchar(100) not null
)

CREATE TABLE Tasks
(
    id uniqueidentifier not null default newsequentialid() primary key,
    [name] nvarchar(max) not null,
    userId uniqueidentifier not null foreign key references Users(id)
)

DECLARE @users TABLE(id uniqueidentifier)
DECLARE @uid uniqueidentifier

INSERT INTO Users(name) OUTPUT INSERTED.id INTO @users VALUES('Jim Bob')
SET @uid = (SELECT TOP 1 id FROM @users)
INSERT INTO Tasks(name, userId) VALUES('Some task', @uid)

P.S. Obviously I have many more tables
I know how to search all database tables for a given value (I've used queries similar what's written here this before). I'm unaware of a simpler solution for uid's if any exist.
With the above, is there a simpler way than looping over tables, then columns of datatype uniqueidentifier, then locating the uid created in order to update its value to say 0x0?
Our database makes use of uniqueidentifier and we have the need to update that value everywhere it's found in our system.

Question: Why?
The whole point on using an arbitrary, sequential identifier is that they should never change them over the entire lifetime of a record, from the point they're created until they are finally deleted.  If you do find you need to change them, then something is badly wrong with the way you're using them.
Also, don't query the &quot;largest&quot; value to find out the id value that MySQL generated - it may not work correctly in a multi-user environment.  Use the provided LAST_INSERT_ID() function instead:
INSERT INTO Users( name ) 
VALUES( 'Jim Bob' ); 

INSERT INTO Tasks( name, userId ) 
VALUES( 'Some task', LAST_INSERT_ID() );   &lt;-- gets the last inserted User