find log file name

Posted on 2014-04-28
Last Modified: 2014-04-28
I am trying to shrink my log file which is huge in SQL.  I am going to use the following to complete the task

USE <db_name>

--find and copy/save the logical name of log file using command below; 
--the first column is the logical file name
EXEC sp_helpfile



    MODIFY FILE ( NAME = <logical_file_name_for_log_file>, SIZE = 100MB, FILEGROWTH = 20MB )

Open in new window

Only problem I'm having is , where do I find the logical file name for log file?
Question by:al4629740
LVL 12

Accepted Solution

Tony303 earned 250 total points
Comment Utility
In SSMS right click your database, properties.
I think the second option down the list is the file data, sorry I'm not at a computer at present.
LVL 34

Assisted Solution

by:Brian Crowe
Brian Crowe earned 250 total points
Comment Utility
SELECT * FROM sys.master_files
WHERE type = 1

and then just narrow it down by database

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now