Click here to Skip to main content
15,880,392 members
Home / Discussions / Database
   

Database

 
GeneralRe: JOIN vs. WHERE Pin
Jörgen Andersson12-Jul-14 20:55
professionalJörgen Andersson12-Jul-14 20:55 
GeneralRe: JOIN vs. WHERE Pin
Klaus-Werner Konrad13-Jul-14 0:35
Klaus-Werner Konrad13-Jul-14 0:35 
GeneralRe: JOIN vs. WHERE Pin
Jörgen Andersson13-Jul-14 1:09
professionalJörgen Andersson13-Jul-14 1:09 
GeneralRe: JOIN vs. WHERE Pin
data modeling guy13-Jul-14 5:57
data modeling guy13-Jul-14 5:57 
GeneralRe: JOIN vs. WHERE Pin
Klaus-Werner Konrad13-Jul-14 1:08
Klaus-Werner Konrad13-Jul-14 1:08 
GeneralRe: JOIN vs. WHERE Pin
Jörgen Andersson13-Jul-14 1:46
professionalJörgen Andersson13-Jul-14 1:46 
QuestionHow to create an audit table? Pin
Bastien Vandamme10-Jul-14 0:30
Bastien Vandamme10-Jul-14 0:30 
AnswerRe: How to create an audit table? Pin
Eddy Vluggen10-Jul-14 8:14
professionalEddy Vluggen10-Jul-14 8:14 
B413 wrote:
I don't like the idea to have metadata like creation_date and update_date in a business oriented table.
It's just a good idea to do so. Makes sorting by creation-order easier, makes it easy to see when the table last was updated - but it's not an audit. It doesn't show who changed what, it merely shows when the object was created, and when it was last modified. You'll find those two attributes on a lot of things.

Fetching the top(update_date) gives a fast indication whether the table has changed since you last loaded it into memory.

B413 wrote:
Is this audit table a good practice ?
Depends; who's responsible for entering data into the new table? Does it happen automatically (using a trigger), or do you depend on the cooperation of the DAL-programmer?

I'd simply be dumping a copy of the entire record (in a separate table, different access-rights), including the user-name and domain. It'd be wasting less space if you only keep a track of the fields that are actually modified then when one makes a complete copy. OTOH, space is cheap nowadays Smile | :)

B413 wrote:
Can I also use this audit table to avoid conflict. You know when two users
update the same record at the same time. It's possible to use the last update
time to warn them there is a conflict.

..and then what? Ask the user to undo the work he's done and type it again? Merge the changes? What if they modified the same field?

It's a bit sweeter to "check out" (or lock) the record once a user starts editing. What sourcesafe does with files works equally well with records.
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

AnswerRe: How to create an audit table? Pin
Mycroft Holmes10-Jul-14 14:15
professionalMycroft Holmes10-Jul-14 14:15 
GeneralRe: How to create an audit table? Pin
GuyThiebaut11-Jul-14 2:09
professionalGuyThiebaut11-Jul-14 2:09 
GeneralRe: How to create an audit table? Pin
Eddy Vluggen11-Jul-14 7:28
professionalEddy Vluggen11-Jul-14 7:28 
GeneralRe: How to create an audit table? Pin
jschell11-Jul-14 9:07
jschell11-Jul-14 9:07 
GeneralRe: How to create an audit table? Pin
Eddy Vluggen11-Jul-14 9:44
professionalEddy Vluggen11-Jul-14 9:44 
GeneralRe: How to create an audit table? Pin
Mycroft Holmes11-Jul-14 14:12
professionalMycroft Holmes11-Jul-14 14:12 
GeneralRe: How to create an audit table? Pin
jschell12-Jul-14 10:33
jschell12-Jul-14 10:33 
GeneralRe: How to create an audit table? Pin
Eddy Vluggen12-Jul-14 22:57
professionalEddy Vluggen12-Jul-14 22:57 
GeneralRe: How to create an audit table? Pin
jschell14-Jul-14 9:05
jschell14-Jul-14 9:05 
GeneralRe: How to create an audit table? Pin
jschell11-Jul-14 9:11
jschell11-Jul-14 9:11 
GeneralRe: How to create an audit table? Pin
Mycroft Holmes11-Jul-14 14:19
professionalMycroft Holmes11-Jul-14 14:19 
QuestionSQL Server Express Setup Command Line Problem Pin
Amr Muhammed9-Jul-14 11:25
Amr Muhammed9-Jul-14 11:25 
AnswerRe: SQL Server Express Setup Command Line Problem Pin
Bernhard Hiller9-Jul-14 21:11
Bernhard Hiller9-Jul-14 21:11 
GeneralRe: SQL Server Express Setup Command Line Problem Pin
Amr Muhammed11-Jul-14 3:28
Amr Muhammed11-Jul-14 3:28 
QuestionError converting data type varchar to numeric Pin
Maideen Abdul Kader5-Jul-14 19:42
Maideen Abdul Kader5-Jul-14 19:42 
AnswerRe: Error converting data type varchar to numeric Pin
Mycroft Holmes6-Jul-14 13:01
professionalMycroft Holmes6-Jul-14 13:01 
QuestionCan not connect to my database from asp .net application Pin
Stephen Holdorf5-Jul-14 0:15
Stephen Holdorf5-Jul-14 0:15 

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.