Refactoring database tables

Hi I am using ms2005 for a simple calendar system. We have three "legacy" tables: groups, units and personnel.

I need to give each record in the tables a unique ID (wrap all 3 tables).

What would be the best way to approach this? I am using NHibernate and I was wondering if it could do this for me.

Anyway, any nods in the right direction are greatly appreciated.

0


source to share


2 answers


The common practice is to create a surrogate primary key in each table using an int with IDENTITY (1,1).



If you need unique values ​​across different systems, use the UNIQUEIDENTIFIER (GUID) column.

+1


source


Are you saying that the same ID should not appear in more than one table? This would be a suspicious statement that suggests more discussion will be needed.



That would be a "bad smell" in the sense of refactoring.

0


source







All Articles