How do I select a column of type uniqueidentifier when I have a guid?
I've tried doing following:
SELECT * FROM MyTable WHERE id = '442402e-207d-b012-4b60-005056c00123'
and
SELECT * FROM MyTable WHERE id = '{442402e-207d-b012-4b60-005056c00123}'
Both give me same error: Error converting data type varchar to uniqueidentifier.
The first query is ok, but you are missing a digit on the first part of the GUID, it should have 8 digits, not seven....something like this:
SELECT * FROM MyTable WHERE id = '71494DD6-90FB-417D-B9E2-28F34103C039'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With