Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.OutOfMemoryException error when I open the Sql Server file

I have a sql server file ( with the .sql format ) when I want open it with SQL Server Management Studio I see a error :

Exepction of type 'System.OutOfMemoryException' was trown

how I solve this problem ?

TnQ

like image 549
Danial Hosseini Avatar asked Feb 20 '26 00:02

Danial Hosseini


1 Answers

The problem you're facing is that the editor of SSMS (SQL Server Management Studio) isn't able to handle such large files, due to memory limitations of the UI (for this reason an OutOfMemory exception is thrown). Most probably, there are memory limitations related to syntax highlighting, Intellisense and so on.

This problem is known, but I couldn't find anything related to the memory limitations in terms of UI while handling large script files (100MBytes and so on, for example). I found only this document, about the maximum capacity specifications.

Anyway, you can run large scripts using the SQLCMD utility, executing this line in a command prompt: SQLCMD -S [Servername] -E -i [SQL Script]

like image 184
Alberto Solano Avatar answered Feb 22 '26 14:02

Alberto Solano