Click here to Skip to main content
16,003,404 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to upload a picture in the database & how to make the search Case sentive Pin
Dave Kreskowiak25-Jun-07 7:14
mveDave Kreskowiak25-Jun-07 7:14 
QuestionNeed help on table design Pin
astv25-Jun-07 6:20
astv25-Jun-07 6:20 
AnswerRe: Need help on table design Pin
Colin Angus Mackay25-Jun-07 6:48
Colin Angus Mackay25-Jun-07 6:48 
GeneralRe: Need help on table design Pin
astv25-Jun-07 8:58
astv25-Jun-07 8:58 
GeneralRe: Need help on table design Pin
Colin Angus Mackay25-Jun-07 9:34
Colin Angus Mackay25-Jun-07 9:34 
AnswerRe: Need help on table design Pin
Colin Angus Mackay25-Jun-07 9:45
Colin Angus Mackay25-Jun-07 9:45 
AnswerRe: Need help on table design Pin
astv25-Jun-07 10:25
astv25-Jun-07 10:25 
GeneralRe: Need help on table design Pin
Colin Angus Mackay25-Jun-07 11:18
Colin Angus Mackay25-Jun-07 11:18 
astv wrote:
Is this ideal to use two different tables storing basically the same information? Should I change the STAFF table relationship to ASSIGN_LOG table?


I was guessing that CreatedBy and AssignedTo would be staff ids (or it could be user ids)

Actually, what is the difference between staff and user in this context?

So in Assignment what does USERS_SID represent? What does STAFF_SID represent? And CreatedBy and AssignedTo? (becuase I'm guessing about all of this)

You aren't, as far as I can see, using two tables to store basically the same information. The Log table shows the historical information, the Assignment table shows the current state along with other information. If you are writing queries that are not interested in historical data then you don't want an additional join to the log table because it will slow things down. It would also be quite a complex join because you'd need to join on the most recent only.

Whether you duplicate the current state in the historical log or not is up to you. I would because it means when you are looking for everything upto and including the current it is there.

So, you might want to set up a trigger on Assignment to INSERT a row in the log to ensure that it is always up-to-date. The minor duplication of data isn't a problem if it is properly managed.


Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5

Ready to Give up - Your help will be much appreciated.


My website

GeneralRe: Need help on table design Pin
astv25-Jun-07 11:34
astv25-Jun-07 11:34 
GeneralRe: Need help on table design Pin
Colin Angus Mackay26-Jun-07 0:04
Colin Angus Mackay26-Jun-07 0:04 
QuestionUsing the LIKE keyword in a query Pin
reegan4125-Jun-07 5:19
reegan4125-Jun-07 5:19 
AnswerRe: Using the LIKE keyword in a query Pin
Kschuler25-Jun-07 8:47
Kschuler25-Jun-07 8:47 
GeneralRe: Using the LIKE keyword in a query Pin
reegan4125-Jun-07 8:51
reegan4125-Jun-07 8:51 
GeneralRe: Using the LIKE keyword in a query Pin
Kschuler25-Jun-07 9:01
Kschuler25-Jun-07 9:01 
QuestionSQL XML 3 BulkLoad Error Pin
Panchal Hardik25-Jun-07 2:28
Panchal Hardik25-Jun-07 2:28 
AnswerRe: SQL XML 3 BulkLoad Error Pin
Dave Kreskowiak25-Jun-07 4:05
mveDave Kreskowiak25-Jun-07 4:05 
QuestionSQL CE Query Performance Pin
Ferudun Atakan24-Jun-07 22:44
Ferudun Atakan24-Jun-07 22:44 
AnswerRe: SQL CE Query Performance Pin
andyharman24-Jun-07 23:12
professionalandyharman24-Jun-07 23:12 
QuestionSelect unique column??? Pin
Doan Quynh24-Jun-07 22:26
Doan Quynh24-Jun-07 22:26 
AnswerRe: Select unique column??? Pin
Colin Angus Mackay24-Jun-07 22:31
Colin Angus Mackay24-Jun-07 22:31 
GeneralRe: Select unique column??? Pin
Doan Quynh24-Jun-07 22:49
Doan Quynh24-Jun-07 22:49 
GeneralRe: Select unique column??? Pin
Doan Quynh24-Jun-07 22:54
Doan Quynh24-Jun-07 22:54 
GeneralRe: Select unique column??? Pin
Colin Angus Mackay24-Jun-07 23:50
Colin Angus Mackay24-Jun-07 23:50 
Questionyou tried to execute a query that doesn't include the specified expression Pin
nitin324-Jun-07 21:58
nitin324-Jun-07 21:58 
AnswerRe: you tried to execute a query that doesn't include the specified expression Pin
Krish - KP24-Jun-07 22:12
Krish - KP24-Jun-07 22:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.