Name Space error VS2015

rflorencio
rflorencio used Ask the Experts™
on
Hi,

I' am trying use the following code to validate a sql query:

       Dim sql As String
        Dim script As Microsoft.SqlServer.SqlParser.SqlCodeDom.SqlScript
        sql = " SELECT * FROM FROM sys.objects"
        'a shared public function, no need to construct an object, so no object.parse method is used.
        script = Microsoft.SqlServer.SqlParser.Parser.Parser.Parse(sql)
        For Each s As Microsoft.SqlServer.SqlParser.Parser.Error In script.Errors
            Debug.Print(s.Message)
        Next

Open in new window


I use Vs 2015, but not recognizes Microsoft.SqlServer.SqlParser.SqlCodeDom.SqlScript name space.

best regards
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Technical Specialist
Awarded 2017
Distinguished Expert 2018
Commented:
You need to add reference to file Microsoft.SqlServer.Management.SqlParser.dll
Download it from http://go.microsoft.com/fwlink/?LinkId=123708&clcid=0x409

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial