Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Transaction Log?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

81 Posts

Posted - 05/01/2013 :  08:15:24  Show Profile  Reply with Quote
Hi, How do I find out the name of the transaction log for a particular db? and where it is stored on disk?

I get a message when deleting from a large table that the transaction log is full, so ust need to truncate it, but I can't find out what its called or where it is....

sure this is simple to find out, but im having difficulty!! any help greatly appreciated....

many thanks!

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 05/01/2013 :  08:41:05  Show Profile  Reply with Quote
In SQL Server, by default the recovery mode is set to FULL. In FULL recovery mode and BULK LOGGED recovery model, the transaction log will keep on growing until you do something about it. See this thread on what you need to do about it:

As to your question about how to find where the files are, use this query:
SELECT DB_NAME(database_id) AS db,name, physical_name FROM sys.master_files
But don't do anything to the physical file. That can be fatal to your database.

If you can live with recovery only based on full backups, you could change the recovery model to simple. I assume you do take regular backups of the database. If you don't you should do that immediately.
Go to Top of Page

Constraint Violating Yak Guru

352 Posts

Posted - 05/01/2013 :  13:40:14  Show Profile  Reply with Quote
Look at

USE YourDatabase;


USE master;
DBCC sqlperf(logspace);

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000