Increase SQL server Maximum Memory from Command Prompt

You can change the min and max amount of memory allocation for each instance in SQL Server Management Studio, the defaults are:

server properties

If you accidentally set the “Maximum Server Memory” to below the amount which could run the services, you might not be able to start the SQL server service from Services or SQL Server Configuration Manager console and you will get this error if you want to log in to SSMS :

Failed to connect to server myServer. (Microsoft.SqlServer.ConnectionInfo)


A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233)


Here are the steps to increase the SQL server memory:

1. If SQL server service is stopped, open the command prompt navigate to your SQL server instance folder (mine is C:\Program Files\Microsoft SQL  Server\MSSQL11.MSSQLSERVER\MSSQL\Binn) and run this command in order to start the service with minimum requirement and single user mode :

 sqlservr -f -m -s nameofyourinstance


2.while keeping previous command prompt open, open a new command prompt as an administrator and navigate to your SQL server instance                folder (mine is: C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn) and run this command to increase instance  memory to 4GB:

 EXEC sys.sp_configure 'show advanced options', 1;
EXEC sys.sp_configure 'min server memory', 1024;
EXEC sys.sp_configure 'max server memory', 4096;

sql command2

3. Now SQL server memory is increased. close those cmd windows and make sure the SQL server service is running by going to SQL Server  Configuration Manager



You should be able to connect to your instance through SSMS.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s