Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In my application I need to keep track of all the users who had created, edited deleted or modified any type of entries. How to maintain those records in sql server 2005. I heard of that log file can be maintained. Please explain me the concept of how log is created or maintained.
Posted

SQL has it's own log file called ".LDF"(log data file)
you can not create your own PDF, if you want to keep track of all database application then, its a customization in your software.
create one AUDIT table, on each insert/update/delete activity put one entry in AUDIT table
for information of LOG files exist in sql
See here[^]
 
Share this answer
 
Hi,

If you want to do this, just create DDL Trigger for this entries:

http://www.sqlteam.com/article/using-ddl-triggers-in-sql-server-2005-to-capture-schema-changes[^]

here is a good article which can help you:

http://www.mssqltips.com/sqlservertip/2085/sql-server-ddl-triggers-to-track-all-database-changes/[^]

Regards
Robert
 
Share this answer
 
1.In Object Explorer, connect to an instance of the SQL Server Database Engine and then expand that instance.

2.Expand Databases, right-click the database from which to add the files, and then click Properties.

3.In the Database Properties dialog box, select the Files page.

4.To add a data or transaction log file, click Add.

5.In the Database files grid, enter a logical name for the file. The file name must be unique within the database.

6.Select the file type, data or log.

7.For a data file, select the filegroup in which the file should be included from the list, or select <new filegroup> to create a new filegroup. Transaction logs cannot be put in filegroups.

8.Specify the initial size of the file. Make the data file as large as possible, based on the maximum amount of data you expect in the database. For more information, see Using Files and Filegroups to Manage Database Growth.

9.To specify how the file should grow, click (…) in the Autogrowth column. Select from the following options:
a.To allow for the currently selected file to grow as more data space is required, select the Enable Autogrowth check box and then select from the following options:
b.To specify that the file should grow by fixed increments, select In Megabytes and specify a value.
c.To specify that the file should grow by a percentage of the current file size, select In Percent and specify a value.

10.To specify the maximum file size limit, select from the following options:
a.To specify the maximum size the file should be able to grow to, select Restricted File Growth (MB) and specify a value.
b.To allow for the file to grow as much as needed, select Unrestricted File Growth.
c.To prevent the file from growing, clear the Enable Autogrowth check box. The size of the file will not grow beyond the value specified in the Initial Size (MB) column.

11.Specify the path for the file location. The specified path must exist before adding the file.

12. Click OK.

Try this steps..
 
Share this answer
 
Comments
Qureshali 24-Jan-12 23:07pm    
how to view that file which will be created using these steps.
dear friend ,
i have one idea for each and every table
u put the following fields
1. Updated Smalldattime get the server date values use (GetDate())
2.Uptime datetime
3.Opearatorcode (who is logged in the application)
same for edit

it will good tracker for all data edit add update
Make this is your answer if it is correct
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900