Curly Braces around the Uniqueidentifier data type in MS SQL 2000

Just have a quick question, I am using the unique identifier data type in MS SQL 2000, and the curly braces around the unique identifier show up when I view the table and when I create a view using the same table, was just curious why they don't show up in query analyzer when I runa query on the table and is there a way to remove the curly braces from the unique identifier field?
Thank you in advance.
wyogirl77Asked:
Who is Participating?
 
kemp_aConnect With a Mentor Commented:
Thank you willcode4cofee, lets distress wyogirl77 some more arguing about the structal format of GUID!

I dont believe that I proposed that a GUID was a "text value", neither did I propose it was a number. The structure of a GUID is essentially a multi-part number that has the following characteristics:

GUID
Globally Unique Identifier. cf UID. Identifier generated according to an algorithm that is intended to be unique across all systems.

As opossed the theory of a hexidecimal numerical system, which would contradict willcode4cofee's theroy that a "number cannot have letters and characters, just numbers" hence we should base our entire thoretical computation on the castugation that A, B, C, D, E & F have no numerical significancewhat so ever!

Back to my original answer to wyogirl77's original question, are there any other fields that you can match your data too?  I cannot see why you would have difficulty using the GUID as long as the format/cast/conversion meets whatever criteria is needed.

Cheers
0
 
willcode4coffeeCommented:
This is just how SQL displays them. Uniqueidentifier is technically a GUID (Globally Unique Identifier) that consists of a 128-bit number. This is an extremely large number and would be even more cumbersome to display that the format you are referring to. So it is displayed in a formatted hexidecimal mask. The curly braces are just an indicator that it is a GUID and are not part of the actual identifier.

M@
0
 
wyogirl77Author Commented:
Ok, but I am trying to merge information from the database into a program I am using and the curly braces show up everytime and I need them to not show up is there a way to not make them show up in the table, since the information is coming straight from the table and being merged into the message I am sending out, it is including the curly braces and I need them to not be included, sorry if this is confusing.
thank you
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
kemp_aCommented:
Hey wyogirl77,
This is not how SQL displays them, it is how Windows makes them. A guid or 'Globally Uniqe IDentifier' is virtually uniuqe to You give or take another 64 thousand other variables!

My question is, Do you have any additonal fields in your table that identify the recipient of your message?
The reasons for asking this is because a GUID is created on a 1 time basis, unique to that space & time, excluding other fields in your table.

What do you expect to recieve back, from the mesages you send out, that would make the GUID un-usable!

Can yo compound some other fields to recognise the response?

0
 
wyogirl77Author Commented:
Well, I am actually helping someone with this so will give you the background, he wants to create unique url's in the message he is sending out, so we are merging the UID field into the message we are sending out, it looks like this, UID={UID} and then when it merges, the link ends up looking like this UID={XXXX-XXXX-.......} and we need it to not include the curly braces, do you know if there is a way to fix this and is it part of Windows or SQL Server?
Thank you
0
 
willcode4coffeeConnect With a Mentor Commented:
You should be able to format the output of it in your SQLselect using some basic substring commands, leaving out the braces.

On a side note, is there a reason you can't have the braces included? I have used them in URLs and they work fine.

M@
0
 
willcode4coffeeCommented:
I beg to differ with kemp_a on the statement that "This is not how SQL displays them, it is how Windows makes them."

This is an inaccurate statement. A GUID is not a text value at all in the database...it is a number. A number. A number cannot have letters and characters, just numbers. It is the same concept as a date in SQL Server. You can display it however you want, but in the database, it is a number.

Therfore, it is stored as a number and displayed as a string. Oracle does not display them with the braces and dashes, but they are the exact same number.

M@
0
 
willcode4coffeeCommented:
Hexidecimal is a way to represent numbers. A format. I give up and bow out of this discussion since you are right and it has nothing to do with the question at hand. However, I don't think using some other fields as identifiers is the answer. That is what a Uniqueidentifier is for. I think the real question is: Can you reformat it to a form you need for the URL? Or is it even neccessary since a GUID is passed in a URL trouble-free.

I have recently written a couple of VB.Net functions that strip the curly braces and dashes out of a string representation of a guid and another that replaces them. I can post them if you would like. Using the logic, you could strip the curly braces when you create the URL, then add them back when doing your database query.

M@
0
 
kemp_aCommented:
Hi wyogirl77
So you return value is being passed to an ASP page or some other web service function, am I correct?

0
 
kemp_aCommented:
willcode4coffee's assistance would be greatly appreciated by wyogirl77 I'm sure, the requirements and aspects of modern systems development are greatly enhanced with diverse points of view
0
 
wyogirl77Author Commented:
I don't think it is an ASP page, we want to use it to track opened emails, let me find out more about the process we are using and thank you both for the insight.
0
All Courses

From novice to tech pro — start learning today.