Error Message:
Msg 5169, Level 16, State 1, Line 1
FILEGROWTH cannot be greater than MAXSIZE for file ‘NewDB’.
Creating Scenario:
CREATE DATABASE [NewDB]
ON PRIMARY
(NAME = N'NewDB',
FILENAME = N'D:\NewDB.mdf' ,
SIZE = 4096KB,
FILEGROWTH = 1024KB,
MAXSIZE = 4096KB)
LOG ON
(NAME = N'NewDB_log',
FILENAME = N'D:\NewDB_log.ldf',
SIZE = 1024KB,
FILEGROWTH = 10%)
GO
USE [master]
GO
ALTER DATABASE [NewDB]
MODIFY FILE ( NAME = N'NewDB', FILEGROWTH = 1024MB )
GO
Workaround / Fix / Solution:
USE [master]
GO
ALTER DATABASE [NewDB]
MODIFY FILE ( NAME = N'NewDB', FILEGROWTH = 1024KB )
GO
USE [master]
GO
ALTER DATABASE [NewDB]
MODIFY FILE ( NAME = N'NewDB', FILEGROWTH = 1024MB, MAXSIZE = 4096MB)
GO
2 Comments. Leave new
What is the reason for setting MAXSIZE? What happens when the production database reach it?
If MAXSIZE is not set, still you will reach to the same state once the database consumes complete available disk space of production database/server.
Anyone knows how to set to recycle database space automatically. In other words by setting a flag it should delete the old data and make room for new data. As per my knowledge this can be achieved by sliding window, but handling is a problem. Like creating partitions and set up job which will remove old partitions and add new partitions on regular interval.