Home Forums SQL Server 2008 T-SQL (SS2K8) Sql Server 2008 R2 Error: An error occurred while executing batch. Error message is: Error creating window handle. RE: Sql Server 2008 R2 Error: An error occurred while executing batch. Error message is: Error creating window handle.

  • I don't think it's an issue of the queries being "large".

    More likely the two while loops *cough* generate a huge number of execution plans being generated and displayed leading to the error message.

    Regardless of the original question: there's most likely more than one alternative to speed up this process and to get rid of the loops.

    But this would require something to test against (DDL, sample data, expected result...).



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]