--BACKUP LOG WITH TRUNCATE_ONLY
--Go
--============= For sql 2008 =====================
USE
GO
SELECT file_id, name FROM sys.database_files
GO
DBCC SHRINKFILE (2, TRUNCATEONLY);
Showing posts with label Log. Show all posts
Showing posts with label Log. Show all posts
Monday, January 25, 2010
Truncate Log
Get Datatabase LOG Size
SELECT
(size * 8)/1024.0 AS size_in_mb,
CASE
WHEN CAST( max_size AS BIGINT )= -1 THEN 9999999 -- Unlimited growth, so handle this how you want
ELSE (CAST( max_size AS BIGINT ) * 8)/1024.0
END AS max_size_in_mb
FROM
sys.database_files
WHERE
data_space_id = 0 -- Log file
Subscribe to:
Comments (Atom)