3

Is there a way to get the namespace Microsoft.Data.Schema.ScriptDom.Sql added to vs 2013, I searched and found that the earlier Microsoft.Data.Schema.ScriptDom has been superseded with TransactSql.ScriptDom but I can't find a way to include the Microsoft.Data.Schema.ScriptDom.Sql. Also just adding TransactSql.ScriptDom does not do the work , I need the Expression class and BinaryExpressionType.GreaterThan, BinaryExpressionType.Equals operators too which I can;t get with only TransactSql.ScriptDom. Can anyone suggest how to get these, or where to find the sql dll

Tom
  • 125
  • 1
  • 11

1 Answers1

4

You should remove the existing reference to ScriptDom from your project and instead add a new reference to Microsoft.SqlServer.TransactSql.ScriptDom.dll.

This is because ScriptDom is no longer shipped with Visual Studio. Since SQL Server 2012 it is shipped with SQL Server instead. The exact dll you should add as a dependency to your project depends on the highest version of SQL server you intend your software to support. The dll is located within a sub folder of the folder you installed SQL server to. You should normally aim to reference the highest version available to you, as the ScriptDom is backwards compatible: you can choose, by selecting the appropriate parser and generator objects, which compatibility level you need. To help you find it, the location of the dll in my setup is: C:\Program Files\Microsoft SQL Server\140\DAC\bin.

rrozema
  • 325
  • 1
  • 7