Click here to Skip to main content
15,792,771 members
Home / Discussions / Database
   

Database

 
QuestionSQL Optimization Pin
Chaminda Bandara16-Feb-15 21:59
professionalChaminda Bandara16-Feb-15 21:59 
AnswerRe: SQL Optimization Pin
Richard MacCutchan16-Feb-15 22:33
mveRichard MacCutchan16-Feb-15 22:33 
AnswerRe: SQL Optimization Pin
Corporal Agarn17-Feb-15 2:45
professionalCorporal Agarn17-Feb-15 2:45 
AnswerRe: SQL Optimization Pin
Mycroft Holmes17-Feb-15 15:03
professionalMycroft Holmes17-Feb-15 15:03 
GeneralRe: SQL Optimization Pin
Chaminda Bandara17-Feb-15 20:06
professionalChaminda Bandara17-Feb-15 20:06 
GeneralRe: SQL Optimization Pin
Mycroft Holmes18-Feb-15 2:14
professionalMycroft Holmes18-Feb-15 2:14 
QuestionVersioned data strategy Pin
LostTheMarbles15-Feb-15 22:08
professionalLostTheMarbles15-Feb-15 22:08 
AnswerRe: Versioned data strategy Pin
GuyThiebaut16-Feb-15 2:44
professionalGuyThiebaut16-Feb-15 2:44 
What I have done is build an audit table:
id	int 
operation nvarchar(50)
table_name nvarchar(200)
col_name nvarchar(200)
key_col nvarchar(200)
key_val nvarchar(200)
col_val_prior nvarchar(MAX)
col_val_new nvarchar(MAX)
username nvarchar(50)
transaction_dt datetime
batch nvarchar(MAX)


id - unique id on this table
operation - insert,delete or update
table_name - name of table operation pertains to
col_name - name of the column operation pertains to
key_col - name of the key column operation pertains to
key_val - value of the key column operation pertains to
col_val_prior - value of col_name column before operation
col_val_new - value of col_name column after operation
username - name of user running operation
transaction_dt - datetime trigger was run
batch - guid that uniquely identifies an operation

I then created three triggers that I add to all tables to be audited(the triggers cover insert, update and delete operations).
This allows me to see all operations on tables I wish to audit.
“That which can be asserted without evidence, can be dismissed without evidence.”

― Christopher Hitchens

AnswerRe: Versioned data strategy Pin
Mycroft Holmes17-Feb-15 14:59
professionalMycroft Holmes17-Feb-15 14:59 
QuestionVB.NET MYSQL sum row values Pin
KipkoechE15-Feb-15 21:51
KipkoechE15-Feb-15 21:51 
AnswerRe: VB.NET MYSQL sum row values Pin
Richard MacCutchan15-Feb-15 23:11
mveRichard MacCutchan15-Feb-15 23:11 
QuestionMYSQL TABLE RECORDS TO ARRAY Pin
KipkoechE15-Feb-15 5:19
KipkoechE15-Feb-15 5:19 
AnswerRe: MYSQL TABLE RECORDS TO ARRAY Pin
Afzaal Ahmad Zeeshan15-Feb-15 5:41
professionalAfzaal Ahmad Zeeshan15-Feb-15 5:41 
GeneralRe: MYSQL TABLE RECORDS TO ARRAY Pin
KipkoechE15-Feb-15 5:46
KipkoechE15-Feb-15 5:46 
GeneralRe: MYSQL TABLE RECORDS TO ARRAY Pin
KipkoechE15-Feb-15 7:15
KipkoechE15-Feb-15 7:15 
AnswerRe: MYSQL TABLE RECORDS TO ARRAY Pin
Eddy Vluggen15-Feb-15 9:18
professionalEddy Vluggen15-Feb-15 9:18 
AnswerRe: MYSQL TABLE RECORDS TO ARRAY Pin
sanket16415-Feb-15 18:43
sanket16415-Feb-15 18:43 
QuestionSSRS report is not fitting withing Margins Pin
indian14313-Feb-15 14:39
indian14313-Feb-15 14:39 
QuestionEdit SSRS report file Pin
indian14312-Feb-15 15:08
indian14312-Feb-15 15:08 
AnswerRe: Edit SSRS report file Pin
Member 1102161912-Feb-15 20:07
Member 1102161912-Feb-15 20:07 
AnswerRe: Edit SSRS report file Pin
Chris Quinn13-Feb-15 1:25
Chris Quinn13-Feb-15 1:25 
GeneralRe: Edit SSRS report file Pin
indian14313-Feb-15 14:36
indian14313-Feb-15 14:36 
QuestionMYSQL RANKING IN A VIEW Pin
KipkoechE12-Feb-15 3:28
KipkoechE12-Feb-15 3:28 
AnswerRe: MYSQL RANKING IN A VIEW Pin
Richard Deeming12-Feb-15 4:26
mveRichard Deeming12-Feb-15 4:26 
GeneralRe: MYSQL RANKING IN A VIEW Pin
KipkoechE12-Feb-15 5:06
KipkoechE12-Feb-15 5:06 

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.