SQL Server 2005 Query

Posted on 2007-07-30
Last Modified: 2010-07-27
Need a query to read current "min_server_memory" and then set it to "min_server_memory+1"
Question by:ourguru
    LVL 25

    Expert Comment

    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.

    Author Comment

    This is a Server Setting updated with sp_configure, I don't know that these values are stored in a table...
    LVL 10

    Accepted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video discusses moving either the default database or any database to a new volume.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now