User Tools

Site Tools


notes:sql:alterdb

ALTER DATABASE

Increase the size of database files:

USE MASTER
GO
ALTER DATABASE MyDatabase MODIFY FILE (NAME='MyDatabase_mdf', SIZE=500MB)
GO
ALTER DATABASE MyDatabase MODIFY FILE (NAME='MyDatabase_ldf', SIZE=250MB)
GO

Change the size of a log file:

-- Increase the log size to 500 MB.
ALTER DATABASE MyDatabase MODIFY FILE
(
    NAME = MyDatabase_ldf, -- logical name
    SIZE = 500MB
)
GO
notes/sql/alterdb.txt · Last modified: 2015/06/24 by admin