SQL Problem : Assign Guid value to UNIQUEIDENTIFIER

Viewed 31

I was trying to assigned the guid data to the uniqueidentifier column but got the issue when assigned with this guid 'ed16e46d-9aaa-4cd9-8c79-d843b5uc246d'. The length and format are correct for guid data but still get the issue 'Conversion failed when converting from a character string to uniqueidentifier.'

Here is my testing script, the first one is the issue value and the section works well.

DECLARE @testA UNIQUEIDENTIFIER = 'ed16e46d-9aaa-4cd9-8c79-d843b5uc246d'

DECLARE @testB UNIQUEIDENTIFIER = '8fc2deba-08f5-4673-9a02-305e92dcb5b1'

1 Answers

Your second GUID beginning 8fc is fine.

Your first GUID is not valid, A GUID can contain only letters A-F, this GUID contains a u.

Check your GUID is valid here: http://guid.us/Test/GUID

Related