We help IT Professionals succeed at work.

Name Space error VS2015

rfl
rfl asked
on
194 Views
Last Modified: 2017-03-16
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

Senior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION