Hi there,
I have a work to update a pre generated table with uuid.
Now the problem is i have to update same uuid for same company. for example
consider a table having the following values .
companyid , value, uuid
1 aa uuid
1 bb uuid
2 cc uuid
3 dd uuid .
here now the uuid is null. i have to update it. the problem is for company 1 the uuid should be same. Please help me

Jitendra KumarRank #760 · 3K reputationPosted Jan 21, 2015, 9:00 PM EST
Update table_name SET uuid =@myid WHERE Companyid = @CompanyID
Ramchand RepalleRank #762 · 3K reputationPosted Jan 21, 2015, 3:43 AM EST
The below update statement works correctly...
UPDATE [TABLE_NAME] SET uuid = 'SOME_VALUE' WHERE Companyid = 1
Please try this and let me know the result...
Thanks,
Ramchand
Akhil GargRank #772 · 3K reputationPosted Jan 21, 2015, 5:20 AM EST
Hi
You need to update it with company id by simple query
Update TABLE_NAME SET uuid = 'Your Val' WHERE Companyid = @In_CompanyID
shan nathan54 reputationPosted Jan 21, 2015, 7:07 PM EST
Jitendra KumarRank #760 · 3K reputationPosted Jan 21, 2015, 8:16 PM EST
if you want same uuid for different company name so why use auto generated uuid.
shan nathan54 reputationPosted Jan 21, 2015, 8:20 PM EST
Jitendra KumarRank #760 · 3K reputationPosted Jan 21, 2015, 8:23 PM EST
Please provide complete table structure.
shan nathan54 reputationPosted Jan 21, 2015, 8:30 PM EST
Jitendra KumarRank #760 · 3K reputationPosted Jan 21, 2015, 8:33 PM EST
shan nathan54 reputationPosted Jan 21, 2015, 8:38 PM EST
id companyid value uuid
1 1 aa null
2 1 bb null
3 2 cc null
4 3 dd null.
Jitendra KumarRank #760 · 3K reputationPosted Jan 21, 2015, 8:45 PM EST
ex :-
Update tab_name SET uuid = 'Your Val' WHERE Companyid = 1 and value= 'aa'
shan nathan54 reputationPosted Jan 21, 2015, 8:51 PM EST
Jitendra KumarRank #760 · 3K reputationPosted Jan 21, 2015, 8:53 PM EST
shan nathan54 reputationPosted Jan 21, 2015, 8:56 PM EST
here 'your val'= (SELECT uuid()).
SELECT uuid() generates different id for each row.
shan nathan54 reputationPosted Jan 21, 2015, 9:10 PM EST
Jitendra KumarRank #760 · 3K reputationPosted Jan 21, 2015, 9:49 PM EST
it is your choice.