--查看内存使用情况SELECT * FROM sys.dm_os_performance_counters WHERE counter_name IN ('Target Server Memory (KB)','Total Server Memory (KB)') -- 设置最大内存sp_configure 'show advanced options', 1 GO --sp_configure 'max server memory', 2147483647 --这是默认值--RECONFIGURE --GO sp_configure 'max server memory', 100 --单位是MRECONFIGURE GO sp_configure 'show advanced options', 0 --立马生效,可以用来临时释放内存--查看最大内存SELECT cfg.name AS [Name], cfg.configuration_id AS [Number], cfg.minimum AS [Minimum], cfg.maximum AS [Maximum], cfg.is_dynamic AS [Dynamic], cfg.is_advanced AS [Advanced], cfg.value AS [ConfigValue], cfg.value_in_use AS [RunValue], cfg.description AS [Description] FROM sys.configurations AS cfg where description like'%memory%'--测试内存的增长DECLARE @I INT SET @I=1WHILE @I<=5BEGIN INSERT INTO t_login_copy(username,name) select name,username from t_login_copySET @I=@I+1 END