Transaction Log with sql server 2008
hi,
I have several number of user login with my sql server 2008.
Can i able to track what are all the users transacting with sql server like selecting,inserting,deleting,updating etc. with corresponding date,user, database, tables ?
Is there any inbuilt functions for taking logs ?
I tried DBCC logs('db_name'). I am not sure whether i am getting correctly the one i need.
Re: Transaction Log with sql server 2008
I don't really understand your question.... If you want to know what user changed what data (inserts,updates and deletes) that is definitly stored in the log file. It is not something that is easly read. If you want to do that I would look for a third party tool (check on Red Gate). The select statements will definitly not be in the log file. The log only records changes to data not just reads.
The other option is to set up a profile trace on the database (this should be a server side trace). This should not be done and left running from the SQL Profiler utility as it will serverly impact the perfromance of the database. If you go this route make your trace as light as possible and save the results to a file. You can then load the trace into Profiler and look at what is going on.
Re: Transaction Log with sql server 2008
What is your intention to log user actions? If it is identifying performance bottlenecks, you should follow Mazz's suggestion.
If you intend to audit users' actions, you should look into building auditing capabilities in your application.
These could be built at the application (front-end) level or built using triggers on tables. A very basic auditing functionality is the use of footprint triggers to identify who changed the record in the table.