none
An error occurred while executing batch. Error message is: Error creating window handle. SQL SERVER 2008

    Question

  • I am running a procedure1 on server1 2008 . It calls procedure2 on a server2 2008. It creates text files perhaps 4k .txt files. While in loop creating text files through bcp handles shoot high in server2. I get error message in red text in message panel through sql server query :
    An error occurred while executing batch. Error message is: Error creating window handle.
    The procedure in server2 continue to run after message appears. All text files are created while message appears. The next line of code in procedure2 on server2 2008 is executed as well after message appears. The message appears until all text files are created and the next line is executed. Then a few minutes later my client Sql server Query in ssms disappears. It closes my ssms window where I call procedure1 in sql server1. anyone could help. very much appreciate it.
    pete


    Thursday, April 23, 2009 9:45 PM

Answers

  • This is a client side issue. Can you check Event Viewer for related messages?

    Client (NOT SERVER!) reboot may fix the issue.


    Kalman Toth SQL SERVER 2012 & BI TRAINING
    New Book: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2012
    Wednesday, February 23, 2011 10:11 AM
    Moderator
  • > Hi, I am getting this error.. Actually there is 50 K records in my query..So it'll take approx 9 minute to run this query but at last it also give error "An error occurred while executing batch. Error message is: Error creating window handle." and also returns some results . Any body have solution for this error.

    First, it's better to start a new thread, than posting to an old thread, even if there are similarities.

    Are you running this query from Management Studio? Judging from the message about the window handle, this is a problem in SSMS. You could try running the query from any of the command-line tools SQLCMD or OSQL to see how that works out. This can help to isolate the error.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    Links for SQL Server Books Online: SQL 2008, SQL 2005 and  SQL 2000.
    (Just click the link you need.)
    Wednesday, February 23, 2011 11:18 AM

All replies

  • Could you post your BCP script?

    Thursday, April 23, 2009 9:48 PM
  • I am seeing the same problem, running a stored proc that does a bunch of insert into/selects. When run with SMSS (2008, all updates) it gets through its main loop several times and then:

    "An error occurred while executing batch. Error message is: Error creating window handle."

    Once this happens SMSS is usually pretty messed up. Hard to say if there was a memory error as it happened during the night and I saw the problem in the morning. The system is not otherwise messed up, and task manager doesn't show any problem in memory usage. There are no corresponding events in the event viewer, system or application.

    anybody else having this problem?

    Friday, January 22, 2010 7:19 PM
  • Hi, I am getting this error.. Actually there is 50 K records in my query..So it'll take approx 9 minute to run this query but at last it also give error "An error occurred while executing batch. Error message is: Error creating window handle." and also returns some results . Any body have solution for this error.
    Wednesday, February 23, 2011 9:44 AM
  • This is a client side issue. Can you check Event Viewer for related messages?

    Client (NOT SERVER!) reboot may fix the issue.


    Kalman Toth SQL SERVER 2012 & BI TRAINING
    New Book: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2012
    Wednesday, February 23, 2011 10:11 AM
    Moderator
  • > Hi, I am getting this error.. Actually there is 50 K records in my query..So it'll take approx 9 minute to run this query but at last it also give error "An error occurred while executing batch. Error message is: Error creating window handle." and also returns some results . Any body have solution for this error.

    First, it's better to start a new thread, than posting to an old thread, even if there are similarities.

    Are you running this query from Management Studio? Judging from the message about the window handle, this is a problem in SSMS. You could try running the query from any of the command-line tools SQLCMD or OSQL to see how that works out. This can help to isolate the error.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    Links for SQL Server Books Online: SQL 2008, SQL 2005 and  SQL 2000.
    (Just click the link you need.)
    Wednesday, February 23, 2011 11:18 AM
  • In SQL Management studio,  set results to text.  Tools-->Options-->Query Results-->

    Sqlserver-->Results to Text   or click on icon  Results to Text.

    Wednesday, May 23, 2012 7:01 PM
  • It is a sign of a memory leak on the SSMS side as a result for example of a long running query outputting alot of information to the result/message panes.

    Typically, that ends with the SSMS crashing.


    Arthur My Blog

    Friday, August 02, 2013 9:47 PM