Scripts in SQL are compiled or executed

随声附和 提交于 2021-02-10 17:29:45

问题


This is like a little existential doubt...

Which is the right way to say that you run a script in SQL?

  1. I compiled the script xxxx

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!