Problem with Microsoft.SqlServer.BatchParser.dll on Windows 64-bit

Answered Problem with Microsoft.SqlServer.BatchParser.dll on Windows 64-bit

  • Freitag, 31. März 2006 16:29
     
     
    First of all, I hope this is the right forum for my problem.  It really spans multiple categories, so it was hard to choose which one to post in.  Also, I cut my teeth on .NET with this particular application, as everything I've done before that was in VB6.  So it's possible that I'm missing something stupid since I'm not a .NET expert by any means.

    My application upgrades a SQL Server database (either 2000 or 2005) that my company's clients use with another app.  It upgrades the db by executing a series of SQL commands.  I am using SMO with the ExecuteNonQuery and ExecuteWithResults functions, which I pass the SQL commands to.

    When I build my solution (which includes an installer), and install it on test machines, everything works fine.  I've even compared the database schema to make sure it upgrades everything.  The problem is, that I can't debug the program on my new development computer - which is running on Windows XP 64-bit - as it gives me an error every time it makes an ExecuteNonQuery or ExecuteWithResults function call.  I can debug this app just fine on my older Windows 2000 development computer, but I'd like to figure this out so I can use it on my faster Windows XP 64 machine.  This leads me to believe it's a problem with the 64-bit platform.  I have the .NET 2.0 Framework (64-bit) installed on here, as well as SQL Server 2005 Standard, and Visual Studio 2005 Standard.

    Here is the error message I get:
    Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. An attempt was made to load a program with an incorrect format.

    I'm hoping there's some fix for this, as I don't want to have to install a 32-bit version of Windows on this machine and start all over.

Alle Antworten

  • Mittwoch, 5. April 2006 14:43
     
     Vorgeschlagene Antwort

    I have the exact same problem,  did you find a solution?

     

    Thanks

  • Mittwoch, 5. April 2006 18:23
     
     Beantwortet

    I found as solution here:

    http://www.microsoft.com/downloads/details.aspx?familyid=D09C1D60-A13C-4479-9B91-9E8B9D835CDC&displaylang=en

     

    Download and install

    X64 Package (SQLServer2005_XMO_x64.msi) - 14675 KB

    This installs the 64 bit smo objects.

  • Donnerstag, 6. April 2006 12:31
     
     

    Thank you - that fixed the problem.  I had already seen that "Feature Pack" webpage, but I didn't think I needed it because I assumed it would be included in the original install CD.

    Thanks again.

  • Montag, 31. Dezember 2007 23:43
     
     
    It worked for me tooooo Smile .....Thank you soooo much, you are a life saver.Smile

     

  • Dienstag, 1. April 2008 21:29
     
     
    Hi, I have the dll "Microsoft.SqlServer.BatchParser.dll" in my bin folder, and I don't want to install it on my computer because I like to put the whole web application on a server some day to which I may not have access (and if I do, they won't ever let me install something global on a production environment). I don't understand why this dll can not be loaded when I start the application from IIS. There does not seem to be a problem when I start the application from within visual studio. Any ideas? Many thanks!

    Rogier


  • Donnerstag, 3. April 2008 21:18
     
     

    I found the maximum flexible solution. I don't want to rely on assembly folders of the server where I will install my application on (they won't let me install any global stuff there). So I put the dll's in my bin folder. When publishing on my 64bit machine, I use the 64bit dll's, when publishing on 32 I use the 32bit versions. That is because opening (testing) via IIS causes a problem when using 32 bits versions on a 64 bit machine. And adding the dll's in the bin folder via visual studio causes always the 32bit versions to be put in the bin folder, even on a 64bit machine.

    How to get all dll's? Install the package as stated by someone above here. Download Total Commander, and go to c:\\Windows\assembly\GAC_64\ and get any 64 bit dll's you want.

    And then I uninstall that 64bit package, because I don't need it... I got the dll's now...

  • Donnerstag, 16. Oktober 2008 22:14
     
     

     

    Thanks for sharing this! Sorted my issue!
  • Freitag, 18. Juni 2010 15:33
     
     
    Worked for me too. Thanks a million!!!!
  • Dienstag, 30. November 2010 14:40
     
     
    Thanks a bunch!!  Worked great.
    Chris Pritchard
  • Dienstag, 22. Februar 2011 22:21
     
     
    Thanks !!
  • Freitag, 8. April 2011 11:32
     
     

    Hi Michael. Thanks for the help.

    I also have experienced this issue on a 64-bit machine. However, this machine is installed with SQL Server 2008, rather than SQL Server 2005. I searched for an equivalent package for SQL Server 2008 but could not find one.

    Would you have any idea where I could look to find this?

    Thanks and regards,

    Ciaran G

  • Dienstag, 1. November 2011 17:44
     
     Beantwortet

    Ciaran, i had this problem too. My machine is a Win 7 64-bit with SQLSERVER 2005 and 2008R2 instances, however my app uses the 2005 instance.

    The solution for it was to install the component that Michel Gustafson mentioned above.

     

    /* Michel Gustafson -----------------------------------------------------------------------

    I found as solution here:

    http://www.microsoft.com/downloads/details.aspx?familyid=D09C1D60-A13C-4479-9B91-9E8B9D835CDC&displaylang=en

     

    Download and install

    X64 Package (SQLServer2005_XMO_x64.msi) - 14675 KB

    This installs the 64 bit smo objects.

    /* ---------------------------------------------------------------------------------------------

     

    Thanks guys!

    Guilherme Rodrigues

  • Dienstag, 8. November 2011 01:08
     
     
    Nothing has worked for me.. sigh.  I can see that the SMO has installed for both 32 and 64 bit as the dlls for the sqlserver.batchparser are both in the GAC.  Any other ideas anyone?
  • Freitag, 30. März 2012 08:36
     
     
    Nothing has worked for me.. sigh.  I can see that the SMO has installed for both 32 and 64 bit as the dlls for the sqlserver.batchparser are both in the GAC.  Any other ideas anyone?

      I meet this also. I just uninstalled the SQLServer2008R2 and install the SQLServer2012, and I made a mistake that uninstalled all *2008R2*, then I found I cannot open some sln contains database project in VS2010 after serval days later.

    At first, I download the SharedManagementObject(x64), but VS2010 still report an error : could not load ...BatchPaser.dll.

    Then I went to the Assembly folder under windows, I found there are 3 dlls named ..BatchParser.dll, one is x86 10.0, one is x86 11.0, the last is x64 11.0, since VS2010 is a x86 program, It can only load the x86 edtion, So I install SharedManagementObject(x86) 10.0

    It works now. Thanks all guys here gave me so much clues.


    • Bearbeitet AceBear Freitag, 30. März 2012 08:37
    •  
  • Dienstag, 31. Juli 2012 00:42
     
     

    I have SQL 2008 R2 x86 version installed on a x64 box. I get this when I attempt to run Powershell scripts that use functions from this library such as ExecuteNonQuery. I get an exception like this:

    Exception calling "ExecuteNonQuery" with "1" argument(s): "ExecuteNonQuery failed for Database 'master'. " ExecuteNonQuery failed for Database 'master'. Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

    This is because I don't have the x64 version of the BatchParser installed. However, if I use the x86 version of powershell "Windows Powershell (x86)" (just type it in Win7 at the Start menu), then it loads the x86 version of BatchParser, and my scripts run fine.

    (This posting is an FYI, not a problem report. I hope it helps someone)

     


    Christopher Scholten 龘龗蘇