SQL Server - Move TempDb Log File

by Administrator 21. January 2010 23:53

ALTER DATABASE TempDB MODIFY FILE
(NAME = templog, FILENAME = 't:\templog.ldf')

Just change the logical name of your log file - and the new physical file location

Note that you need to restart SQL Server for this to take effect

 

SQL Server - Force Database Log File Shrink

by Administrator 6. October 2009 20:51

 

USE DATABASENAME
GO
DBCC SHRINKFILE(LOGNAME, 1)
BACKUP LOG DATABASENAME WITH TRUNCATE_ONLY
DBCC SHRINKFILE(LOGNAME, 1)


Buy Me a Beer ?

If you've found this site useful, you could help support its running costs by either checking out the adverts on the page if you find anything that interests you - or by making a small donation