SQL 中的脚本被编译或执行 [英] Scripts in SQL are compiled or executed

查看:37
本文介绍了SQL 中的脚本被编译或执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这有点像存在的怀疑...

This is like a little existential doubt...

在 SQL 中运行脚本的正确说法是什么?

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

  1. 我编译了脚本 xxxx

  1. I compiled the script xxxx

我执行了脚本 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.

非常感谢.

推荐答案

这取决于您实际想说的内容.

It depends on what you actually want to say.

SQL Server 中的所有查询在执行之前都遵循相同的过程.

All queries in SQL Server follow the same process before they are executed.

  • Parse - 语句被分解为单独的单词.在此步骤中检测到语法错误和拼写错误.
  • 验证(又名解析)——确保存在对象的名称以及正确的所有权权限.
  • 优化 - SQL Server 探索了执行查询的不同方式.
  • 编译 - SQL Server 生成执行计划(执行树的二进制表示)

最后

  • 执行

这篇关于SQL 中的脚本被编译或执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆