Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-10-13 : 08:02:08
|
| Rani writes "TWO HARD QUESTIONS FOR YOU! (aren't you so excited?)I need to know how to create a PROCEDURE that will output the mean and standard deviation of a table, which I created with the name Account, and then output the results to me.Second, this is the harder one, I need to create a table named ActionHistory consisting of two columns, TableName and ActionTime, then create a TRIGGER that will write the name of the previous table "Account" into the TableName portion, and the time of the change/update into the ActionHistory portion, whenever there is a change/update made to the Account table. To sort of keep track of all the action made to the Account table, so if someone were to manipulate it, we'd know which table (I will be creating this for multiple tables) as well as WHEN (datetime). PLEASE HELP!!!!!THANKS." |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2005-10-13 : 15:02:56
|
| http://www.oreilly.com/catalog/transqlcook/chapter/ch08.htmlCheck that out for your statistics question.For your second question, are you talking about auditing DML? Do you want to know when someone inserts a new row? http://www.google.com/search?hl=en&q=sql+server+audit+triggerOr, are you talking about auditing DDL? Do you want to know when someone adds a new column? For that you should look at setting up a server side trace ... look up sp_trace* in BOL.Jay White |
 |
|
|
|
|
|