Click here to Skip to main content
15,912,082 members
Home / Discussions / Database
   

Database

 
GeneralRe: Query Access db where date/time ... Pin
Rob Graham3-Aug-05 9:07
Rob Graham3-Aug-05 9:07 
Generaltracking actions in sql Pin
WetRivrRat3-Aug-05 5:35
WetRivrRat3-Aug-05 5:35 
GeneralRe: tracking actions in sql Pin
Rob Graham3-Aug-05 6:20
Rob Graham3-Aug-05 6:20 
GeneralRe: tracking actions in sql Pin
WetRivrRat3-Aug-05 7:05
WetRivrRat3-Aug-05 7:05 
GeneralRe: tracking actions in sql Pin
Rob Graham3-Aug-05 7:15
Rob Graham3-Aug-05 7:15 
GeneralRe: tracking actions in sql Pin
Anonymous3-Aug-05 7:20
Anonymous3-Aug-05 7:20 
GeneralRe: tracking actions in sql Pin
WetRivrRat5-Aug-05 8:40
WetRivrRat5-Aug-05 8:40 
GeneralRe: tracking actions in sql [Edit] Pin
Rob Graham5-Aug-05 9:22
Rob Graham5-Aug-05 9:22 
I would use separate triggers for insert and update. The Deleted pseudoTable will not exist in the case of an insert, so the handling will likely need to be different. In both cases the new data can be accessed in the "Inserted" psuedoTable.
The for insert, for update triggers would seem nore sensible here than an after or instead of...


Could be as simple as "if Inserted.Access_level <> Deleted.Access_level then rollback transaction"

For inserts, I suspect you will want to check the user that is inserting the record (not the user being added)
- SELECT user_name() will return this, but this might be probematic if the application is always logged in as sysadmin - dbo - (it shouldn't be, but that is another matter).

Yuo should likely disallow changes to more than on record at a time (rollback if @@rowCount > 1) as this would seem inappropriate in any case, and allows succeeding checks to assume only one row (the current one) in the psuedo tables.


Absolute faith corrupts as absolutely as absolute power
Eric Hoffer

All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke

GeneralRe: tracking actions in sql [Edit] Pin
WetRivrRat5-Aug-05 9:55
WetRivrRat5-Aug-05 9:55 
GeneralRe: tracking actions in sql [Edit] Pin
Rob Graham5-Aug-05 11:45
Rob Graham5-Aug-05 11:45 
GeneralWhich is better Pin
WDI3-Aug-05 3:34
WDI3-Aug-05 3:34 
GeneralRe: Which is better Pin
toxcct3-Aug-05 5:13
toxcct3-Aug-05 5:13 
GeneralRe: Which is better Pin
Member 15192134-Aug-05 22:31
Member 15192134-Aug-05 22:31 
GeneralOracle download Pin
Bhuvanish3-Aug-05 2:11
Bhuvanish3-Aug-05 2:11 
GeneralRe: Oracle download Pin
toxcct3-Aug-05 5:15
toxcct3-Aug-05 5:15 
GeneralCannot add view in Server Explorer Pin
Daniel Hintz2-Aug-05 18:31
Daniel Hintz2-Aug-05 18:31 
GeneralRe: Cannot add view in Server Explorer Pin
Christian Graus2-Aug-05 19:16
protectorChristian Graus2-Aug-05 19:16 
GeneralRe: Cannot add view in Server Explorer Pin
Frank Kerrigan2-Aug-05 21:24
Frank Kerrigan2-Aug-05 21:24 
GeneralRe: Cannot add view in Server Explorer - PROBLEM SOLVED Pin
Daniel Hintz3-Aug-05 16:11
Daniel Hintz3-Aug-05 16:11 
GeneralPosting again...Plz need help...Table relationships Pin
Nosheen Iqbal2-Aug-05 18:00
Nosheen Iqbal2-Aug-05 18:00 
GeneralRe: Posting again...Plz need help...Table relationships Pin
Frank Kerrigan2-Aug-05 21:26
Frank Kerrigan2-Aug-05 21:26 
GeneralRe: Posting again...Plz need help...Table relationships Pin
Anonymous3-Aug-05 2:37
Anonymous3-Aug-05 2:37 
GeneralRe: Posting again...Plz need help...Table relationships Pin
Scott Serl3-Aug-05 7:15
Scott Serl3-Aug-05 7:15 
GeneralAccess...pass a value from one form to another form Pin
vtalau2-Aug-05 16:54
vtalau2-Aug-05 16:54 
GeneralRe: Access...pass a value from one form to another form Pin
Hassanur3-Aug-05 21:07
Hassanur3-Aug-05 21:07 

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.