sql - Loop and assign non-unique GUID to sets of values? -
I easily believe this, but I can not go past the concept for the syntax I have a table of features like many rows where the name of the feature can populate: I have assigned a GUID to the name you want to do:
[nAME], [GUID] Fred, minus Fred, minus Fred, minus Tom, null Mary, null Mary, null Mary null I null
Fred { 3b26af27-9d42-481c-a8c8-be1819dccda5} Fred, {3b26af27-9d42-481c-a8c8-be1819dccda5} Fred, {3b26af27-9d42-481c-a8c8-be1819dccda5} Tom, {ee64b706-def0-4e5c-a5fd-0c219962042e} Mary , {fd158f90-9705-4a18-b82c-baca29441401} me, {fd158f90-9705-4a18-b82c-baca29441401} me, {fd158f90-9705-4a18-b82c-baca29441401} me, {fd158f90-9705-4a18-b82c-baca29441401 }
table (name varchar (30), GUID uniqueidentifier) insert @tmp announced choose to select from (MyTable @tmp x.Name, NEWID () the difference name) X update MyTable set GUID = tmp.GUID from MyTable T insider @tmp which t.Name = on tmp tmp.Name
Comments
Post a Comment