What is the difference between SET NOEXEC ON and SET PARSEONLY ON? Currently, SQL server supports the following statements: SET NOEXEC and SET PARSEONLY.
From the documentation:
SET NOEXEC ON:

When SET NOEXEC is ON, SQL Server compiles each batch of Transact-SQL statements but does not execute them.

SET PARSEONLY ON:

When SET PARSEONLY is ON, SQL Server only parses the statement.

I guess it's &quot;compiles&quot; vs. &quot;parses&quot;. &quot;Compiles&quot; should include &quot;parses&quot;.
If I want to verify the correctness of SQL Scripts which one should I use? I am inclined to answer: SET NOEXEC ON.
But what else does compile do? Does &quot;compile&quot; mean the execution plans are created/modified? Is the existence of objects checked?
What happens if you have:
SET NOEXEC ON
SET PARSEONLY OFF

I find having both options available confusing.
Thanks
The order of the tasks in executing a SQL query are parsed, compile and execute.
PARSE
SQL Server parses the syntax of a T-SQL. For a successful query execution. It should have valid syntax. It also checks for the variable declaration, query identifiers.
COMPILE
SQL Server checks for the objects, whether they exist or not. It also checks user permissions. During the compilation phase, SQL Server also optimizes the query execution and comes with an optimized execution plan using available indexes and statistics
EXECUTE
Once SQL Server completed parse and compilation, SQL Server executes query batch and returns output to the client
So if you have the following settings the engine do parse and compile tasks but not execute.
SET NOEXEC ON
SET PARSEONLY OFF