dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Using GUID as Primary Key

  1. #1
    Join Date
    Oct 2019
    Posts
    3

    Using GUID as Primary Key

    Can we use a GUID column as a primary key in a table?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,562

    Re: Using GUID as Primary Key

    Yes.
    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2019
    Location
    Ahmedabad
    Posts
    5

    Re: Using GUID as Primary Key

    GUID can be used as a Primay key but it's having some drawbacks like :

    (1) They are large(16 bytes) that is they will consume more space .
    (2) Even performance and storage implications are present in this.
    (3) They do not sort well as they are essentially random numbers.
    (4) They are hard to remember as well as hard to debug.
    (5) They can make URL's harder to read.

    Do refer this link : https://blog.codinghorror.com/primar...-versus-guids/

  4. #4
    Arjay's Avatar
    Arjay is online now Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,177

    Re: Using GUID as Primary Key

    Quote Originally Posted by Sherin Mathew View Post
    GUID can be used as a Primay key but it's having some drawbacks like :

    (1) They are large(16 bytes) that is they will consume more space .
    (2) Even performance and storage implications are present in this.
    (3) They do not sort well as they are essentially random numbers.
    (4) They are hard to remember as well as hard to debug.
    (5) They can make URL's harder to read.

    Do refer this link : https://blog.codinghorror.com/primar...-versus-guids/
    Dated info. Those are largely problems of the past, at least on newer versions of SQL Server anyway.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)