Is that I have been creating a table in SQL that implements GUID, for it I review this question:
What are the best practices for using a GUID as a primary key, specifically regarding performance?
Here an answer tells me to use a GUID key and also another key, but with Identity, so that:
CREATE TABLE dbo.MyTable
(PKGUID UNIQUEIDENTIFIER NOT NULL,
MyINT INT IDENTITY (1,1) NOT NULL,
.... add more columns as needed ......)
ALTER TABLE dbo.MyTable
ADD CONSTRAINT PK_MyTable
PRIMARY KEY NONCLUSTERED (PKGUID)
CREATE UNIQUE CLUSTERED INDEX CIX_MyTable ON dbo.MyTable (MyINT)
My question is: why use an int key when it says that we are already using the GUID?