收缩数据库日志
时间:2021-07-01 10:21:17
帮助过:44人阅读
[databasename]
DECLARE @DataFileName VARCHAR(
255);
SET @DataFileName = (
SELECT name
FROM sysfiles
WHERE groupid
= 1);
DECLARE @TargetSize INT;
-- Select current size and substract 500 MB
SET @TargetSize = ROUND(
8 * (
SELECT size
FROM sysfiles
WHERE groupid
= 1)
/ 1024,
0)
- 512;
EXEC (
‘DBCC SHRINKFILE (‘ + @DataFileName + ‘, ‘ + @TargetSize + ‘)‘);
收缩数据库日志
标签:basename ase filename log get http class database 模式