我以前有過這樣的問題,我發現這個問題,你可以創建一個存儲過程的解決方案,如下所述:您啓動應用程序之前,您應該調用模式這個存儲過程1,因爲你需要足夠的內存
對於SQL操作和關閉應用程序之前,你必須在模式0
Create Proc [dbo].[MP_Rpt_ConfigureMemory]
(@Mode bit)
as
declare @RAM as integer
declare @MAX as integer
declare @MIN as integer
set @RAM = (SELECT
[physical_memory_in_bytes]/1048576 AS [RAM (MB)]
FROM [sys].[dm_os_sys_info])
Set @MAX = ((@RAM/4) * 3)
Set @MIN = ((@RAM/4) * 1)
if @Mode = 0
begin
exec SP_Configure 'min server memory', 1
RECONFIGURE
exec SP_Configure 'max server memory', 100
RECONFIGURE
end
else
if @Mode = 1
begin
exec SP_Configure 'max server memory', @MAX
RECONFIGURE
exec SP_Configure 'min server memory', @MIN
RECONFIGURE
end
如果您發佈的代碼,XML或數據樣本,** **請在高亮文本編輯器這些線路上,並點擊了的「代碼示例」按鈕('{}')編輯器工具欄很好地fo rmat和語法突出顯示它! – 2011-04-26 20:27:50