How to set database size limit on MSSQL Server?

Please refer to the following steps to set the database size limit for Microsoft SQL Server.

Using SQL Management Studio

  1. Login to your SQL Management Studio.

  2. Right-click on the database for which you want to set the limit and click on properties.

  3. At the database properties dialogue box, click on the files.

  4. Here, you will find a button called Autogrowth / maxsize. Click on it.

  5. It will open a dialogue box with the name change Autogrowth for the database.
  6. Tick on Enable Auto Growth option. Inside Maximum File Size, check the radio button and set the maximum size you want to set for the same database.

Using SQL Query

  1. Connect to your Database Engine and click on the New Query.

  2. Run the below query and change your database and database file name.

    USE master;
    GO
    ALTER DATABASE your_db_name
    MODIFY FILE
        (NAME = db_file_name,
        SIZE = 50MB);
    GO
  3. You can run the below query to find the file name of your database.

    USE MyDataBase
    SELECT name
    FROM sys.database_files
    WHERE type_desc = ‘ROWS’;
    GO

Related Articles

How to fix “Reporting Services Catalog Database File Existence” error while installing SQL Server?

You may receive the below error while installing the SQL server on your windows system. This...

How to shrink MSSQL Database?

Important Note: We don't recommend to shrink your database. You can involve your Database...

How to identify and fix the orphan users in MSSQL Server?

Orphaned user in MSSQL means that a user who is present at the database level but the relevant...

How to fix "Upgrade Error - Valid Database compatibility level and successful connection rule"?

One of our Windows VPS customers wanted to upgrade SQL Server from SQL Server 2008 R2 to SQL...

How to configure MSSQL server default language configuration option?

Recently, we faced strange issue wherein one of our customers was capturing error messages coming...

  • 0 Users Found This Useful

Was this answer helpful?