为什么我们在SQL中使用Exec [英] Why do we use Exec in SQL

查看:186
本文介绍了为什么我们在SQL中使用Exec的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai All,我是SQL新手。我想知道为什么我们在sql中使用EXEC?



谢谢和问候,

Hai All, I am new to SQL. I would like to know why we use EXEC in sql?

Thanks and Regards,

推荐答案

EXEC用于在SQL SERVER中执行SP。
EXEC is used to execute SPs in SQL SERVER.


Quote:

执行命令字符串或字符串Transact-SQL批处理或以下模块之一:系统存储过程,用户定义的存储过程,CLR存储过程,标量值用户定义函数或扩展存储过程。 EXECUTE语句可用于向链接服务器发送传递命令。



示例



EXEC则sp_help; - sp_help是一个内置函数。此命令用于执行sp_help。



就像使用EXEC命令执行此存储过程一样。

Executes a command string or character string within a Transact-SQL batch, or one of the following modules: system stored procedure, user-defined stored procedure, CLR stored procedure, scalar-valued user-defined function, or extended stored procedure. The EXECUTE statement can be used to send pass-through commands to linked servers.

Example

EXEC sp_help; -- sp_help is a built in function. this command is used to execute sp_help.

like this stored procedures are executed by using EXEC command.


你骂这个链接

https://msdn.microsoft.com/en-IN/library/ms188332.aspx [ ^ ]


这篇关于为什么我们在SQL中使用Exec的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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