Does anyone know what the limitations are in SQL Server 200x Query Parser?
When I try to parse a lengthy query in SQL Server 2005, I see the following error:
===================================
Cannot parse script.
===================================
Exception of type 'System.OutOfMemoryException' was thrown. (mscorlib)
------------------------------ Program Location:
at System.String.InternalSubString(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.TrimHelper(Char[] trimChars, Int32 trimType) at Microsoft.SqlServer.Management.UI.VSIntegration.ShellCodeWindowControl.GetS electedTextSpan() at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptEditorControl .GetSelectedTextSpan() at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptAndResultsEdi torControl.OnParseScript(Object sender, EventArgs a)
Michael Coles (ad...@geocodenet.com) writes: > Interesting. Looks like it affects sqlcmd also.
I don't think SQLCMD is affected. Several years ago, it might have been already during the beta of SQL 2005, I helped someone who had insanely big SQL scripts. SSMS choked on fairly moderate sizes. SQLCMD had now problems. Hm, if you have a 2GB script, 32-bit SQLCMD might get problems. But there is a 64-bit version of SQLCMD.
The upper limits for SSMS are certainly quite tiny. And before you hit those hard limits, you will find that performance is awful.
-- Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
Rob (R...@discussions.microsoft.com) writes: > Does anyone know what the limitations are in SQL Server 200x Query Parser?
> When I try to parse a lengthy query in SQL Server 2005, I see the > following error:
>===================================
> Cannot parse script.
>===================================
> Exception of type 'System.OutOfMemoryException' was thrown. (mscorlib)
This is not an error from the SQL 2005 parser. This is an error from SQL Server Mgmt Studio.
I see in the comment to the Connect item you filed, that your script fails with SQLCMD too. As I said in another post, my experience is that SQLCMD is able to handle much larger files than SSMS. Possibly, in could be that you have one very big query batch. I know was able to get some really big files through SQLCMD, but I think they had "go" after every INSERT. (Or, hm, did I just put them in with a Perl script?)
But there is indeed a limit on the size of a query. According to books online that is 65536 * network packet size. The default net work packet size is 4096, which gives an upper limit of 258 MB.
The topic "Maximum Capacity Specifications for SQL Server" has more details.
-- Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
> Michael Coles (ad...@geocodenet.com) writes: >> Interesting. Looks like it affects sqlcmd also.
> I don't think SQLCMD is affected. Several years ago, it might have been > already during the beta of SQL 2005, I helped someone who had insanely > big SQL scripts. SSMS choked on fairly moderate sizes. SQLCMD had now > problems. Hm, if you have a 2GB script, 32-bit SQLCMD might get problems. > But there is a 64-bit version of SQLCMD.
> The upper limits for SSMS are certainly quite tiny. And before you hit > those hard limits, you will find that performance is awful.
> -- > Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se