I am using Powershell to write a T-SQL query validation to validate it before it actually get executed in database.
I want to check whether it is only a select-statement or involves any table/view drop/created, and return error if there is not only one single select-statement.
I checked the MSDN SQL Server Tool and UI Class Library tool but haven't found the way to do it.
Can you help me to find a way?
Below is the environment I am working with:
Remote database: SQL Server 2012
Powershell version on desktop: 4.0
SQL Server Management Studio on desktop: 2014
Desktop OS: Win 7