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

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 How to shrink log file in sql 2005

Author  Topic 

ganeshkumar08
Posting Yak Master

187 Posts

Posted - 2009-04-27 : 01:50:29
Hi,
I have a problem in shrinking a log file in sql server2005.
Below is the code i used to shrink log file.

USE Master
GO
DBCC SHRINKFILE('F:\Central Repository\Kandasamy\DB 24-09-2008\CricTestData_1.ldf', 1)
BACKUP LOG CricTestData WITH TRUNCATE_ONLY
DBCC SHRINKFILE('F:\Central Repository\Kandasamy\DB 24-09-2008\CricTestData_1.ldf', 1)
GO

after running the above code, error is displayed as below

Msg 8985, Level 16, State 1, Line 1
Could not locate file 'F:\Central Repository\Kandasamy\DB 24-09-2008\CricTestData_1.ldf' for database 'master'.
Msg 8985, Level 16, State 1, Line 3
Could not locate file 'F:\Central Repository\Kandasamy\DB 24-09-2008\CricTestData_1.ldf' for database 'master'.

Can any one please help me in shrinking log file. due to that problem i was not able to insert data in the table.

Thanks
Ganesh

Solutions are easy. Understanding the problem, now, that's the hard part

hitesh6221
Starting Member

28 Posts

Posted - 2009-04-28 : 04:13:08
Ganesh You can do while useing Master DB to perform on any UserDB so u have to use perticulerDB and then you can fire DBCC commands


Regards,
Hitesh Soni
Go to Top of Page
   

- Advertisement -