Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Store proc or trigger Expand / Collapse
Author
Message
Posted Monday, August 13, 2012 5:36 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Saturday, November 3, 2012 8:04 PM
Points: 37, Visits: 123
I have a situation where, we have

SQL Server 2005 Standard edition SP4
- Over 100 little table per customer
- each table have around 40 rows
- each table contains variable and value assinged as configuration


Now any of these variable/vaule pair can be changed for any of the cust table. I need a way of tracking the old value and new value as once the value is overriden its gone unless I manully store them somewhere.

Now I know that trigger would have to be per table which means too many of them hence perfromane issue. So I think Store proce would be the way forward but I am kind of stuck at design level.

Any pointers would be great..so far I know that

1. I need an archive table
2. track any changes - here is my issue e.g. what parameters to use so all linked etc..
3. right them to archive table first
4. update original table

I am not a developer so I could do with any help. Thanks in Advance...
Post #1344083
Posted Tuesday, August 14, 2012 10:17 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, July 21, 2014 4:52 PM
Points: 7,079, Visits: 12,569
Know that the number of triggers is not the determining factor for performance. Instead consider the complexity of the trigger and the volume and frequency of transactions against these tables. For the majority of databases adding a trigger to each table for each type of operation (update & delete) to create an audit trail will be suitable.

You did a nice job of relaying your project requirements clearly however this is a forum with unpaid volunteers and you have a fair bit of work ahead of you. You could search the web for examples of "generic audit triggers" for SQL Server (or similar phrases) to see if someone has provided something you can pickup and use as-is. Since you said you're not a developer you may want to consider hiring a professional to assist you with this.


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1344851
Posted Wednesday, August 29, 2012 9:06 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Saturday, November 3, 2012 8:04 PM
Points: 37, Visits: 123
Sorry for the delay but I have sorted this using a store proc utilising dynamic sql. It wasnt that hard to be honest. Its been deployed in our prod env and working fine.
Post #1351685
Posted Wednesday, August 29, 2012 9:47 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, July 21, 2014 4:52 PM
Points: 7,079, Visits: 12,569
Are you saying you created one stored proc that handles inserts, updates and deletes for over 100 tables using dynamic sql?

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1351734
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse