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 KumarPosted Jan 22, 2015, 2:00 AM
Update table_name SET uuid =@myid WHERE Companyid = @CompanyID
Jitendra KumarPosted Jan 22, 2015, 2:49 AM
it is your choice.
shan nathanPosted Jan 22, 2015, 2:10 AM
shan nathanPosted Jan 22, 2015, 1:56 AM
here 'your val'= (SELECT uuid()).
SELECT uuid() generates different id for each row.
Jitendra KumarPosted Jan 22, 2015, 1:53 AM
shan nathanPosted Jan 22, 2015, 1:51 AM
Jitendra KumarPosted Jan 22, 2015, 1:45 AM
ex :-
Update tab_name SET uuid = 'Your Val' WHERE Companyid = 1 and value= 'aa'
shan nathanPosted Jan 22, 2015, 1:38 AM
id companyid value uuid
1 1 aa null
2 1 bb null
3 2 cc null
4 3 dd null.
Jitendra KumarPosted Jan 22, 2015, 1:33 AM
shan nathanPosted Jan 22, 2015, 1:30 AM
Jitendra KumarPosted Jan 22, 2015, 1:23 AM
Please provide complete table structure.
shan nathanPosted Jan 22, 2015, 1:20 AM
Jitendra KumarPosted Jan 22, 2015, 1:16 AM
if you want same uuid for different company name so why use auto generated uuid.
shan nathanPosted Jan 22, 2015, 12:07 AM
Akhil GargPosted Jan 21, 2015, 10:20 AM
Hi
You need to update it with company id by simple query
Update TABLE_NAME SET uuid = 'Your Val' WHERE Companyid = @In_CompanyID
Ramchand RepallePosted Jan 21, 2015, 8:43 AM
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