Which version of SQL Server are you running, and any Service Packs? It appears that for some people installing SQL Server 2008 SP1 has resolved the problem.
http://support.microsoft.com/kb/968382
The problem is caused by SQL Server running out of RAM, so if you have very little RAM memory in your server it can't execute long SQL statements. Other reports say that turning off the "Resource Governor" in the database made the problem go away. This governor can limit the amount of memory available for execution even if you have lots of RAM. You can read more about the governor here:
http://technet.microsoft.com/en-us/library/bb933866.aspx
Also, if you are on a 32-bit platform, some people also had to double the MemToLeave parameter. It is a startup parameter specified with -g512 (double the normal 256MB). The size of executable SQL statements has to fit in this memory on 32-bit platforms. How to set startup parameters can be found here:
http://msdn.microsoft.com/en-us/library/ms190737.aspx
If you have a lower compatibility mode set on your database than the default, this may also cause the problem, as that database sort of becomes "sandboxed" and gets resource limits different from what is stated for the version you are running.
Please, let us know if any of these helped.