0

I want to set Minimum and Maximum server Memory for a SQL Server using T-SQL. I am able to do it using SSMS->Object Explorer->Server Properties but don't know how to do it using T-SQL commands. Along with this, also can anyone help me out with how to set 'Processor Affinity' using T-SQL commands ?

Thanks in advance.

1 Answers1

0

To find the current values, take a look at the sys.configurations system view. Like so:

select * from sys.configurations
where name in ('min server memory (MB)', 'max server memory (MB)')

To change one or both of those values, use sp_configure. You'll also need to call reconfigure afterwards for the new setting to take effect. Like so:

exec sp_configure 'max server memory (MB)', 10240; -- 10 Gb
reconfigure;
Ben Thul
  • 3,024
  • 17
  • 24