Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

SQL Server guid vs INT- Which is better as a primary key?

Asked by Ankesh Kumar Apr 23, 2021 1.3K views 1 answer
Share

About this question

I've been reading around reasons to use or not guid and int. int seems smaller, faster, easy to remember, and keeps a chronological sequence. However, as for Guid, the only advantage I see is that it is unique. In which situation do you think SQL server guid would be better to use? Int only seems to have one disadvantage of the number limit, which is irrelevant in many cases. So, why exactly was SQL server Guid created? It should have a purpose more than just serving as the primary key of a simple table. (Any example of a real application using Guid for something?)

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.