0

Screenshot of files, location & DBs in Microsoft SQL Server Management Studio Express GUI:

I've looked at several answers and tutorials on how to clear out the LDF via GUI and SQL commands, but that is assuming the DB is visible.

Via GUI I went to: DB SBSMonitoring > Tasks > Delete > Log files and gain about 1-2 GB space.
It's location on disk is: C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data

What steps can I take to add this DB/ or clear out without adding?

enter image description here

0

Shrink the log files using the following statement. Do this OUT OF OFFICE HOURS!

-- Connect to the database that you want to shrink
USE <DATABASENAME>; 
-- Set the recovery model to SIMPLE
ALTER DATABASE <DATABASENAME> SET RECOVERY SIMPLE; 
-- Issue a CHECKPOINT to purge out the inactive transactions
CHECKPOINT;
-- Shrink the transaction log file to a reasonable size
DBCC SHRINKFILE (<LOGICAL NAME OF LDF>, 5); 
-- Set the recovery model back to FULL
ALTER DATABASE <DATABASENAME> SET RECOVERY FULL; 

You can find out the logical file name for the database using:

USE <DATABASENAME>; 
SELECT Name FROM sys.database_files
| improve this answer | |
  • Thanks for replying colin. The entire folder is visible to you. There's bunch of files visible there and not sure which ones to pick off for Sharepoint I do not have the Database Name I know where the files are so I need it the other way around.. Get DB name from the damn files in that folder - How? – Alex S Apr 16 '16 at 9:56
  • Yo can run a query after connecting to the correct instance of SQL Server. I think the name is SSEE, but you can check the name by starting sql server configuration manager, then see all the different MSSQL services running. Behind in () will be the Instance name – Colin Apr 16 '16 at 10:12
  • network-nick.blogspot.be/2011/11/… – Colin Apr 16 '16 at 10:13
  • connection string is : \\.\pipe\mssql$microsoft##ssee\sql\query – Colin Apr 16 '16 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.