简体   繁体   English

尝试运行由SQL Server Management Studio生成的创建表脚本时出现System.OutOfMemoryException

[英]System.OutOfMemoryException when trying to run a create table script generated by SQL Server Management studio

i've 8GB of ram, when i tried it on a 16GB machine the script runs fine, all it does is it creats 2 tables and fills them with data, about 12000 records for each table and 38 columns for the first table and 18 columns for the second table. 我有8GB的ram,当我在16GB的计算机上尝试该脚本时,脚本运行良好,它所做的只是创建了2个表并填充了数据,每个表大约有12000条记录,第一个表有38列,第18列第二张桌子。

the script was generated by sql manager studio 2012 it self and the size of the script is about 78MB. 该脚本由sql manager studio 2012自行生成,脚本大小约为78MB。

how can i run it on 8GB machine without getting an out of memory exception? 如何在没有内存不足异常的情况下在8GB机器上运行它?

the script has an Insert command for each record. 该脚本为每个记录都有一个插入命令。

its seems to be a know issue and yet microsoft doesn't have fix http://connect.microsoft.com/SQLServer/feedback/details/269566/sql-server-management-studio-cant-handle-large-files 它似乎是一个已知问题,但是Microsoft尚未修复http://connect.microsoft.com/SQLServer/feedback/details/269566/sql-server-management-studio-cant-handle-large-files

all i did split the script to smaller pieces and it worked fine on the 8GB machine. 我所做的所有工作都将脚本分成了较小的部分,并且在8GB的计算机上运行良好。

If the script is running fine on a 16 GB machine, you can try increasing the virtual memory of your own machine. 如果脚本在16 GB计算机上运行良好,则可以尝试增加自己计算机的virtual memory But that could result in longer execution time of your script. 但这可能会延长脚本的执行时间。

Instead, you should consider increasing RAM of your own machine. 相反,您应该考虑增加自己计算机的RAM。

To increase VM of your machine, go to 要增加计算机的VM,请转到

System properties->Advanced->Performance->Settings->Advanced->Virtual Memory->Change 系统属性->高级->性能->设置->高级->虚拟内存->更改

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM