Hi daelmo, thanks for your help.
daelmo wrote:
Why do you want this T-SQL audit?.
The project is a government project. They have a ton of rules and regulations on audition with respect to privacy act junk. Basically the cust has a requirement to log the specific SQL query that was called to access certain personal information such as SSN, address , etc. Personally, I think it's silly. So what if I logged the query used to access data, there is a chance the query results may differ from the time the original request was made. Pain in the a$$ if you ask me. But, as you know as a developer, you've got to give the customer what they want.
daelmo wrote:
If you want to log all the queries sent to the server, maybe the best option would be a sql profiler tool.
Does there exist such a tool? I know there exists a SQL Server profile tool, but I wouldn't want the customer to have to have it running all the time on the server. Maybe I'm missing something here. I'm by no means an expert w.r.t. profiling. If you can offer suggestions regarding this potential route, I'm all ears.
daelmo wrote:
**Where would you grab the queries? **(tables? file?)
My original plan was to some how capture the sql before it get's created/executed by the DAL. Kind of like the how the audit DI works. It would be cool if I could override some method and simply aquire the final assembled sql which has executed on the server. You know what I mean?
daelmo wrote:
Do you plan to audit ALL queries, or just for certain operations (what operations? over what objects?)
As it stands now it's only tables that have personal information in them. Like name, address, SSN, etc. Given the scheme this means only one table. But I'm thinking, what if a query is made involving a join of this personal info table? I'm thinking I have to log the sql query as well.
Thanks again for your help. Hopefully this will shed some light.
Bob