Click here to Skip to main content
15,905,414 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want create a table which has a primary key column which column contain NEWID(). For this scenario which data type is better Varchr(36) or Char(36) for better performance.


please anybody help me with better suggestion.
Posted

1 solution

hi,

NEWID() data type is "uniqueidentifier". Refer http://msdn.microsoft.com/en-us/library/ms190348.aspx[^]

Always going to be storing 36 characters, I would suggest you keep using CHAR. If you were storing data of varying length, go with VARCHAR.

Refer: http://stackoverflow.com/questions/5691212/sql-server-guid-to-varchar36-or-char36[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900