Limit SQL Server Database Memory Usage (RAM)

If you want to limit the amount of RAM a SQL database uses, run this TSQL script against ‘master’. Replace 29491 with the amount of memory in MB that is the maximum SQL can use.

USE master
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO
sp_configure 'max server memory', 29491;
GO
RECONFIGURE WITH OVERRIDE;
GO

Leave a Reply

Your email address will not be published. Required fields are marked *