Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Reseting memory in DB [modified]

Reseting memory in DB [modified]

Scheduled Pinned Locked Moved Database
databasehelpcsharpc++sharepoint
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MAW30
    wrote on last edited by
    #1

    I found the following sp on this website, when I run by right clicking on the procedure using the command "Execute Stored Procedure" it works fine. However, when I run the sp from C# I get the following error: //err.Message = "Microsoft SQL Native Client: //CONFIG statement cannot be used inside a user transaction.\\42000 = 574; //Microsoft SQL Native Client: Configuration option 'show advanced options' //changed from 0 to 1. Run the RECONFIGURE statement to install.\\01000 = 15457" ALTER PROCEDURE [dbo].[sp_Database_ResetMemory] AS EXEC sp_configure 'show advanced options', 1; RECONFIGURE WITH OVERRIDE; EXEC sp_configure 'max server memory (MB)'; EXEC sp_configure 'max server memory (MB)', 512; RECONFIGURE WITH OVERRIDE; EXEC sp_configure 'max server memory (MB)'; WAITFOR DELAY '00:00:15'; EXEC sp_configure 'max server memory (MB)', 2147483647; RECONFIGURE WITH OVERRIDE; EXEC sp_configure 'max server memory (MB)'; EXEC sp_configure 'show advanced options', 0; RECONFIGURE WITH OVERRIDE; Can anyone tell me what the problem is. Thanks in advance, Michael

    modified on Thursday, May 26, 2011 12:50 PM

    R 1 Reply Last reply
    0
    • M MAW30

      I found the following sp on this website, when I run by right clicking on the procedure using the command "Execute Stored Procedure" it works fine. However, when I run the sp from C# I get the following error: //err.Message = "Microsoft SQL Native Client: //CONFIG statement cannot be used inside a user transaction.\\42000 = 574; //Microsoft SQL Native Client: Configuration option 'show advanced options' //changed from 0 to 1. Run the RECONFIGURE statement to install.\\01000 = 15457" ALTER PROCEDURE [dbo].[sp_Database_ResetMemory] AS EXEC sp_configure 'show advanced options', 1; RECONFIGURE WITH OVERRIDE; EXEC sp_configure 'max server memory (MB)'; EXEC sp_configure 'max server memory (MB)', 512; RECONFIGURE WITH OVERRIDE; EXEC sp_configure 'max server memory (MB)'; WAITFOR DELAY '00:00:15'; EXEC sp_configure 'max server memory (MB)', 2147483647; RECONFIGURE WITH OVERRIDE; EXEC sp_configure 'max server memory (MB)'; EXEC sp_configure 'show advanced options', 0; RECONFIGURE WITH OVERRIDE; Can anyone tell me what the problem is. Thanks in advance, Michael

      modified on Thursday, May 26, 2011 12:50 PM

      R Offline
      R Offline
      Ravi Sant
      wrote on last edited by
      #2

      My ex-colleague came across similar message. Not sure about this, but if sql server is running in mixed authentication mode and you are using sql authentication, this must have occurred.

      // ♫ 99 little bugs in the code, // 99 bugs in the code // We fix a bug, compile it again // 101 little bugs in the code ♫

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups