| Author |
Topic |
|
Riku Tuominen
Starting Member
22 Posts |
Posted - 2002-06-25 : 10:44:36
|
| Does SQL Server 2000 save information about its tables when they where last modified, on its system tables or something? |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-06-25 : 10:49:13
|
| Nope. |
 |
|
|
MakeYourDaddyProud
184 Posts |
Posted - 2002-06-25 : 11:00:52
|
| The way to go about this is using an audit trigger. Easy to construct. That way you can pipe a default date constraint to your audit table and any other snippets of info in you inserted and updated tables.What exactly are u trying to do?Dan<<monet makes money>> |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-06-25 : 11:20:57
|
| I would pause and consider before creating triggers on system tables. (I'm interpretting you question as modifications to a table schema, as opposed to data modification)<O> |
 |
|
|
MakeYourDaddyProud
184 Posts |
Posted - 2002-06-25 : 11:58:49
|
| Riku never implied system tables were being used, just how to get the the modification data of a table (which might have led to some form of select from a system table, which according to rob, doesnt exist) I was just providing a method of logging a change audit to a production table.Dan<<monet makes money>> |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-06-25 : 12:06:25
|
| Maybe Riku needs to clarify. When I read "...information about its tables when they where last modified..." that means to me when a non-system table is modified, not when a record in a non-system table is modified. Assuming Riku is talking about schema modifications, then the only way to audit these types of changes, using your triggers, is going to be to place the triggers on sysobjects and syscolumns. Am I wrong?<O> |
 |
|
|
MakeYourDaddyProud
184 Posts |
Posted - 2002-06-25 : 12:24:34
|
| Aha, I can see where you coming from now. Its a double edge sword. Tehehehe.Dan<<monet makes money>> |
 |
|
|
Riku Tuominen
Starting Member
22 Posts |
Posted - 2002-06-25 : 13:24:10
|
| Sorry my english.Danny explaned it quit well what my problem was:"Riku never implied system tables were being used, just how to get the the modification data of a table (which might have led to some form of select from a system table, which according to rob, doesnt exist)"Is the Audit Trigger the best solution then Page47.You opinion is valuable.Thank you both for the responses, you already made! |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-06-25 : 13:31:30
|
| Here's the bottom line.If you want to audit schema changes (stuff like adding a column to a table or changing the datatype of a column), a good answer has not yet been provided for you. I'm not sure there is one.If, on the otherhand, you want to audit changes to data in a table (stuff like INSERT/UPDATE/DELETE statments issued to a table and what the old and new values of columns are), then the trigger suggestion is a valid one. I'd search this site for 'Audit', you can probably find some cut&paste code to get you started.<O> |
 |
|
|
Riku Tuominen
Starting Member
22 Posts |
Posted - 2002-06-25 : 14:52:19
|
| Yes Page47 it's "stuff like INSERT/UPDATE/DELETE ...".Thanks to you both!! |
 |
|
|
|