Script to configure SQL Server Maximum Memory

Grant Holliday’s blog

Senior Service Engineer, Microsoft Visual Studio Team Foundation Service

Script to configure SQL Server Maximum Memory

Rate This
  • Comments 0

I’ve often got SQL Server running on my workstation, laptop or VPC and find that it just soaks up all my memory. This script sets the maximum limit:

USE [master]

GO

-- Set max server memory limit

EXEC sp_configure 'show advanced options', 1

RECONFIGURE WITH OVERRIDE

 

EXEC sp_configure 'max server memory (MB)', 484

RECONFIGURE WITH OVERRIDE

 

-- Check the setting

EXEC sp_configure 'max server memory (MB)'