Hi,
I need insert a hard code uniqueidentifier into a table, data type is uniqueidentifier. The value was got from another table and data type is uniqueidentifier. But when I execute the script, I got error:
"Conversion failed when converting from a character string to uniqueidentifier." the following is the script. I have tried CONVERT() and got the same error. Any idea, how should I do it?
Insert into table1(f1,f2,f3,f4,f5...f10)
select 21,'apple',CAST('221651A5-36A5-85EB-5A3B-BBC465928673' AS uniqueidentifier),...f10
from table2
where table2.status ='N'
Thank you so much for any helps and ideas!!!
I need insert a hard code uniqueidentifier into a table, data type is uniqueidentifier. The value was got from another table and data type is uniqueidentifier. But when I execute the script, I got error:
"Conversion failed when converting from a character string to uniqueidentifier." the following is the script. I have tried CONVERT() and got the same error. Any idea, how should I do it?
Insert into table1(f1,f2,f3,f4,f5...f10)
select 21,'apple',CAST('221651A5-36A5-85EB-5A3B-BBC465928673' AS uniqueidentifier),...f10
from table2
where table2.status ='N'
Thank you so much for any helps and ideas!!!