If you have the ability to change it, you may want to consider moving away from the 36 digit alphanumeric created by GUID()
as a Key. This is often misused in SQL-Server by developers who have not had proper training/education in SQL Server and or RDBMS. The GUID()
is not intended to be a Primary Key but a way to generate a unique value when working across multiple systems. Most databases are not setup like this, they are self-contained. Even if they are using data from outside sources, they still are self-contained in that all their tables are in a single DB on a single SQL Server instance. While using the GUID()
will create a unique value, it carries overhead with it that makes it a non-optimal choice for a Primary Key when you don’t need to create a unique value that is unique across all databases on all your systems.
As for how to generate a unique key, if you are using SQL Server as your tag as your post indicates, you can let SQL Server do this for you by setting the column of the table that is your primary key to auto-increment a unique value.