简体   繁体   English

存储过程和扩展存储过程之间的差异

[英]Difference between stored procedures and extended stored procedures

What is the basic difference between SQL Server stored procedures (sp_) and extended stored procedures (xp_)? SQL Server存储过程(sp_)和扩展存储过程(xp_)之间的基本区别是什么? Why there are extended procedures anyway? 为什么还有扩展程序?

Extended stored procedures are written in c/c++(I believe anything that can create a DLL in native code), stored procedures are written in T-SQL 扩展存储过程是用c / c ++编写的(我相信任何可以在本机代码中创建DLL的东西),存储过程都是用T-SQL编写的

extended stored procedures exist because they allow you to do things that you cannot do in T-SQL like running DOS command (xp_cmdshell) 存在扩展存储过程,因为它们允许您执行在T-SQL中无法执行的操作,如运行DOS命令(xp_cmdshell)

BTW do not name your procs starting with sp_..that is bad practice...see Don't start your procedures with SP_ BTW没有以sp _开头命名你的过程..这是不好的做法...请参阅不要用SP_开始你的程序

An extended stored procedure executes code that is not SQL. 扩展存储过程执行非SQL的代码。 It's normally written with external code like in C++. 它通常用C ++中的外部代码编写。

Using Extended Stored Procedures 使用扩展存储过程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM