SQL Server 2005 Query

Need a query to read current "min_server_memory" and then set it to "min_server_memory+1"
ourguruAsked:
Who is Participating?
 
ksaulConnect With a Mentor Commented:
Never actualy done this but you can read the value from sys.configurations
select value_in_use
from sys.configurations
where name = 'min server memory (MB)'

You should not update system tables directly - use sp_configure.  So something like this might work:


declare @minservmem sql_variant,
      @minservmemint int

select @minservmem = value_in_use
from sys.configurations
where name = 'min server memory (MB)'

set @minservmemint = convert(int, @minservmem) + 1

exec sp_configure 'min server memory (MB)', @minservmemint

go


http://msdn2.microsoft.com/en-us/library/ms189631.aspx
0
 
SStoryCommented:
if this value is in a table and you know its name and have permissions, you could do the query like this, o

Update whatevertable SET min_server_memory=min_server_memory+1

However this would need a where clause, if min_server_memory is the primarykey of a table and in such case, I'd assume the value would be a field and you'd want to do something like:

update whatevertable SET value=value=1 where keyfield="min_server_memory"

I don't have SQL 2005 on this machine, so I couldn't find the table having this value to see how it is i setup. This is the basic way to do it.
0
 
ourguruAuthor Commented:
This is a Server Setting updated with sp_configure, I don't know that these values are stored in a table...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.