Can anyone please help me?
I am having bunch of .sql files. I want to parse (validate) those files before executing them on server.
I have many online sites which parse the code. But I want to parse the code using C#.
So please can you guide. If there is any tool, dll I need to use.
I just want to parse the file and not execute it
A way to do it is to execute it on the server, except with SET PARSEONLY ON (so that it's parsed but not executed): I think that's how the MS Query Analyzer does it.
You can have procedure which can get the query as input and
in SQL Server side you can have a SET PARSEONLY ON statement and then "run" the
query. The query won't actually run, but any errors will be reported.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With