FIX: Error message when you run a long stored procedure that is encrypted in SQL Server 2005: "A stack overflow occurred in the server while compiling the query"
Source: Knowledge Base
Product: Microsoft SQL Server 2005 Enterprise X64 Edition, SQL Server 2005 Enterprise Edition & SQL Server 2005 Standard Edition
Notification Contents: New
FIX: Error message when you run a long stored procedure that is encrypted in SQL Server 2005: "A stack overflow occurred in the server while compiling the query"
http://support.microsoft.com/kb/934246/en-US