<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SET NOEXEC on AdaTheDev Blog</title><link>https://www.adathedev.co.uk/tags/set-noexec/</link><description>Recent content in SET NOEXEC on AdaTheDev Blog</description><generator>Hugo -- gohugo.io</generator><managingEditor>adathedev@gmail.com (Adrian Hills)</managingEditor><webMaster>adathedev@gmail.com (Adrian Hills)</webMaster><lastBuildDate>Thu, 01 Jul 2010 22:31:00 +0100</lastBuildDate><atom:link href="https://www.adathedev.co.uk/tags/set-noexec/index.xml" rel="self" type="application/rss+xml"/><item><title>Validating an SQL query programmatically, with gotcha</title><link>https://www.adathedev.co.uk/2010/07/validating-sql-query-programmatically.html</link><pubDate>Thu, 01 Jul 2010 22:31:00 +0100</pubDate><author>adathedev@gmail.com (Adrian Hills)</author><guid>https://www.adathedev.co.uk/2010/07/validating-sql-query-programmatically.html</guid><description>If you want to check the validity of a TSQL statement programmatically, you can make use of the SET NOEXEC statement. As this MSDN reference states, SET NOEXEC ON will compile the query but won&amp;rsquo;t actually execute it. This is ideal (well, nearly&amp;hellip;.) if perhaps you have a dynamically generated statement that you want to check is valid before executing it.
Example time SET NOEXEC ON GO SELECT TOP * FROM sys.</description></item></channel></rss>