DBCC 命令是存储过程还是函数?

2021-09-15 00:00:00 user-defined-functions sql-server dbcc

DBCC 命令应该叫什么?DBCC 过程还是 DBCC 函数?

What should be the DBCC commands be called ? DBCC procedure or DBCC function?

这是令人困惑的,因为DBCC PAGE 可以在没有前缀EXEC 语句的情况下执行,很像存储过程.但是 EXEC DBCC PAGE(1,1,1,3) 抛出错误

It is confusing because DBCC PAGE could be executed without prefixing a EXEC statement much like stored procedures. But EXEC DBCC PAGE(1,1,1,3) throws an error

语法错误 - 关键字 'DBCC' 附近的 Msg 156 语法不正确

Syntax error - Msg 156 Incorrect syntax near the keyword 'DBCC'

它不是函数,因为函数调用必须在SELECT中进行,而是

And it isn't a function because function calling must be made in SELECT, but

SELECT DBCC PAGE(1,1,1,3)

显示相同的错误.

推荐答案

据我所知,DBCC 代表 Data-Base-Console-Command.因此,DBCC 本身既不是过程也不是函数.它只是一个你回想起来的控制台.

As far as I know DBCC stands for Data-Base-Console-Command. Therefore, DBCC by its self is neither a procedure nor a function. It is simply a console that you recall.

相关文章