Ways to validate T-SQL queries?

前端 未结 6 1879
逝去的感伤
逝去的感伤 2021-01-03 10:48

I have access to an Access database and within that database are fields filled with TSQL queries. These queries are processed by T-SQL on a server. So when I write these SQL

6条回答
  •  执念已碎
    2021-01-03 11:42

    The Data Dude (Gert Drapers) describes how to use the built-in SQL Server T-SQL parser in your application here:

    • Getting to the Crown Jewels

    If you want to only check the validity of the SQL statements that you have - this might be a nice way to go, and it doesn't require SQL Server per se to be installed where you run your unit tests.

    It's a .NET based approach, and it cannot - of course - validate object names in your database if you're not using a live database - but it can catch syntactical errors in your T-SQL statements.

提交回复
热议问题