Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 multiple colums as primary keys

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-03-31 : 22:57:00
wajid hussain writes "Hi folks,

I'm using 2 fields (change_id & release) as the primary key for my main table which has a one-2-many relationship with 7 other tables. I'm using the change_id & release as foreign keys in the seven child tables. Thats an extra field on all seven tables. Is this duplication/bad practise? Or should I be adding a dummy (identity /Autonumber) field as the primary key instead? even though I have been told that we should avoid using the identity field as primary key. Many thanks.

WAJ"

nr
SQLTeam MVY

12543 Posts

Posted - 2002-03-31 : 23:12:53
It's really up to you.
You can create a release table which assigns an id to the change_id and release and use that id on all the other tables. This means that you can change the release numbering system - in fact the structure would mean that you are building this in as a requirement.

==========================================
Cursors are useful if you don't know sql.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -