Hello,
In our sql server database we have Id column in each table. This column is not primary key column but it is made as identity column. We have one more column for primary key. The data type of this column is guid.
The purpose of having Id column in each table is:
1) clustered index should not create on guid column.
2) Id column is very useful in case of migration.
This practice was implemented in our last project But our current client said we should remove Id column from each table and we should create clustered index on guid column.
Client also said that if we remain Id column in each table then we should have valid reason for that.
Please let me know should I remove Id column from each table or not.
Below is the example of our table structure:
CREATE TABLE [dbo].[PlanRider](
[Id] [int] IDENTITY(1,1) NOT NULL,
[PlanRiderId] [uniqueidentifier] NOT NULL,
[CompanyId] [uniqueidentifier] NOT NULL,
[PlanDetailId] [uniqueidentifier] NOT NULL,
[BasePlanId] [uniqueidentifier] NOT NULL,
[RiderPlanId] [uniqueidentifier] NOT NULL,
[RiderType] [varchar](10) NOT NULL,
[CreatedBy] [uniqueidentifier] NULL,
[CreatedDate] [datetime] NULL,
[UpdatedBy] [uniqueidentifier] NULL,
[UpdatedDate] [datetime] NULL,
[PageReference] [nvarchar](100) NULL,
[RowStatus] [int] NULL,
CONSTRAINT [PK_PLanRider] PRIMARY KEY NONCLUSTERED
(
[PlanRiderId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
What I have tried:
This practice was implemented in our last project so I implemented the same in current project.