问题
This is like a little existential doubt...
Which is the right way to say that you run a script in SQL?
I compiled the script xxxx
I executed the script xxxx
I know is a little weird and noob to ask this, but I need to know.
I'm very sure the second way is the correct one, but I need more opinions.
Thank you very much.
回答1:
It depends on what you actually want to say.
All queries in SQL Server follow the same process before they are executed.
- Parse - Statement is broken down into individual words. Syntax errors and misspellings are detected on this step.
- Validate (aka Resolve) – Ensures that the names of the objects are present as well as correct ownership permissions.
- Optimise – SQL Server explores different ways to execute the query.
- Compile – SQL Server generates execution plan (binary representation of the execution tree)
and finally
- Execute
来源:https://stackoverflow.com/questions/52786834/scripts-in-sql-are-compiled-or-executed