which data type use for GUID

Posted by Sagarp under Sql Server on 12/14/2009 | Views : 7210 | Status : [Member] | Replies : 3
HI



I give 1 field in my table SGUID tell me which DataType i will use also tell how can use in simple insert query.means which form,string or int



Thanks

Sagarp
http://www.emanonsolutions.net

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/



Responses

Posted by: Chikul on: 12/14/2009 [Member] Bronze

Up
0
Down

Hi Sagarp ,

The GUID is a 16-byte binary data type .It logically grouped like the following.

4byte-2byte-2byte-2byte-6byte.
ex : {12345678-1234-1234-1234-1234567890AB}.

It having 36 Characters.
So While doing coding we can use "String" Data Type for GUID .
and Using String we can manipulate it easily.

ex: we can remove "-". So it will be like
{123456781234123412341234567890AB}.

Regards,
Chikul

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chikul on: 12/14/2009 [Member] Bronze

Up
0
Down
Hi,

you can check the example here.

http://www.dotnetfunda.com/codes/code486-get-random-passward-string-using-guid-passward-length-maximum-32.aspx

Regards,
Chikul

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Komminedi on: 12/24/2009 [Member] Starter

Up
0
Down
GUID is a 16-byte binary data type

Follow this link for more information.

http://msdn.microsoft.com/en-us/library/dd354925.aspx



Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response