What is the LDF file in SQL Server? what is its purpose?
can I safely delete it? or reduce its size because sometimes it's 10x larger than the database file mdf.
What is the LDF file in SQL Server? what is its purpose?
can I safely delete it? or reduce its size because sometimes it's 10x larger than the database file mdf.
The LDF file holds the database transaction log. See, for example, http://www.databasedesign-resource.com/sql-server-transaction-log.html for a full explanation. There are ways to shrink the transaction file; for example, see http://support.microsoft.com/kb/873235.
The LDF is the transaction log. It keeps a record of everything done to the database for rollback purposes.
You do not want to delete, but you can shrink it with the dbcc shrinkfile command. You can also right-click on the database in SQL Server Management Studio and go to Tasks > Shrink.