SMO SQL Server Error Reading Stored Procedures Collection

The following error is appearing while running Visual Studio 2005 and developing an application with SMO capabilities. It appears when trying perform a foreach( on ActiveDB.StoredProcedures).

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 found an MSDN article that recommends downloading the 64 bit SMO assembly.

Here is the Microsoft MSDN article that talks about SQL Server connectivity for both 2005 and backward compatibility.

I had to close all applications, especially Visual Studio and then installed the following application.

My system info is:

  • OS Name – Microsoft® Windows Vista™ Home Premium
  • Version – 6.0.6001 Service Pack 1 Build 6001
  • System Type – x64-based PC
  • Processor – AMD Turion(tm) X2 Dual-Core Mobile RM-70, 2000 Mhz, 2 Core(s), 2 Logical Processor(s)

The installation took care of updating and using the latest SMO objects in the project. No removing of Assemblies or references was needed. Worked like a charm.

Leave a Reply