sql server - Should identity column be added table that uses date and a foreign key? -


i'm making small asp.net mvc application allows me set dish schedules me , people in house. have table called dishdates keeps track of has dish day on date. contains 3 columns (dishdateid, personid, , date). dishdateid pk, personid fk person table , date date of day dishes on.

we have 1 person on dishes on given day. personid tied date. app can auto generate dish calendar month. now, can go in , regenerate new dish list month has had 1 created, application goes , deletes existing records month , creates them. every time this, dishdateid field's values increase because identity column.

i know won't problem because can have on 2 billion rows still suffice way longer lifetime of app. but, case smarter not use identity column , have personid , date field , make date pk? feel identity column kind of in way or something, or unnecessary.

screenshot of dishdates data

when recreating personid , dates values, create them in temp table , use merge function based on matching dates (as constant value , personid variable value in given row).

yes, don't need identity column of datedishid per se, if using process above, count of rows not increased every iteration of same months' data.

i'll let calculate how long take fill identity column dates though, given identity int, you, me, roommates, or world know it, unlikely around, it's nothing sweat about!


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -