[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

find log file name

Posted on 2014-04-28
2
Medium Priority
?
261 Views
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

ALTER DATABASE <db_name>
    SET RECOVERY SIMPLE

DBCC SHRINKFILE ( 2 )

ALTER DATABASE <db_name>
    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?
0
Comment
Question by:al4629740
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
Tony303 earned 750 total points
ID: 40028123
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.
0
 
LVL 34

Assisted Solution

by:Brian Crowe
Brian Crowe earned 750 total points
ID: 40028126
SELECT * FROM sys.master_files
WHERE type = 1

and then just narrow it down by database
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

650 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