Skip to content
Ask the community about this page

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

Symptoms

You receive the following error:

Failure

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

Discussed in the community

Looking for related questions…

Didn't find your answer? Ask the community about this page — questions are answered by Timextender experts, partners and other users.