Skip to main content

Error: Could not load file or assembly 'Microsoft.SqlServer.BatchParser.dll'


Christian Hauggaard
Community Manager
Forum|alt.badge.img+5

Symptoms

You receive the following error:

Could not load file or assembly 'Microsoft.SqlServer.BatchParser.dll' or one of its dependencies. The specified module could not be found.
The error text may also include the following details:

An error occurred during executing this statement \r\n IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[<TableName>]') AND OBJECTPROPERTY(id, N'IsTable') = 1) DROP TABLE [<TableName>];: ExecuteNonQuery failed for Database '<DatabaseName>'.

Cause

The server is missing or unable to call a necessary dynamic-link library (dll) file. On a typical machine, you may find multiple copies of Microsoft.SqlServer.BatchParser.dll. However, in some configurations, the dll’s installed with TimeXtender and SQL Server Management Studio (SSMS) do not seem to load, while the ones installed with SMO 2016 are.  

Resolution

Download Microsoft SQL Server® 2016 Service Pack 2 Feature Pack and install the following packages:

  1. ENU\x64\SharedManagementObjects.msi
  2. ENU\x64\SQLSysClrTypes.msi
Did this topic help you find an answer to your question?

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings