maintaining case while inserting GUIDs into SQL Server tables

G

Guest

Hi All,

I am trying to insert a GUID generated in .NET into my SQL Server tables. I
am inserting it into a column of type uniqueidentifier. The GUID generated by
..NET has lower case alphabets in it but after i insert it into the SQL Server
tables, all the lower case alphabets get converted into upper case alphabets.
This causes problems when i retreive it and compare to the one stored locally
in my program. Isn't the GUID case sensitive? Has anybody encountered this
problem before? Any ideas or suggestions on how to resolve this issue will be
greatly appreciated.

Thank You,
Vish
 
G

Gordon Smith \(eMVP\)

Vish said:
Hi All,

I am trying to insert a GUID generated in .NET into my SQL Server
tables. I am inserting it into a column of type uniqueidentifier. The
GUID generated by .NET has lower case alphabets in it but after i
insert it into the SQL Server tables, all the lower case alphabets
get converted into upper case alphabets. This causes problems when i
retreive it and compare to the one stored locally in my program.
Isn't the GUID case sensitive? Has anybody encountered this problem
before? Any ideas or suggestions on how to resolve this issue will be
greatly appreciated.

Thank You,
Vish

A GUID is a 16 byte binary value. The form you see is merely a string
representation of the GUIDs value. If you want to compare the STRINGS, I'd
suggest that you do a case-insensitive compare.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top