SQL Server语言扩展性能
SQL Server语言扩展功能在外部进程中执行。这是否意味着当在Select子句中调用此函数时,它会为应用程序的每个行中的每个行创建一个新的过程?
A SQL Server Language Extension function is executed in an external process. Does it mean that when such a function is called in a Select clause it creates a new process for every row in the recordset on which it is applied?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您正在混淆两个不同的功能 /技术。
sqlClr 是运行.NET代码的能力(最常见于C#或vb.net,但有时是Visual C ++,有时是F#,尽管F#不受正式支持) SQL Server进程。该代码可以称为存储过程,触发器,标量功能,表值功能,聚合功能,甚至用户定义的类型。即使存在主动事务,也可以在调用会话中执行T-SQL(即正确执行执行)。
外部脚本(语言扩展)比SQLCLR更新,并且不是.NET特定的。可以使用的语言是:R,Python,Java和最近的C#。该代码只能通过 sp_execute_external_script 存储过程;没有选项可以通过函数调用这些外部脚本。因此,没有每行执行的概念。这些脚本由单独的服务(IE外部)执行,因此没有选项的t-sql代码执行(含义:通过外部脚本执行T-SQL将作为单独的会话连接)。
)。
其他详细信息可以在我的帖子中找到:
sqlclr vs sql Server 2017,第8部分:SQLClr是否已弃用python或r(sp_execute_external_script)?
I think you are confusing two different features / technologies.
SQLCLR is the ability to run .NET code (most often C# or VB.NET, but sometimes Visual C++ and occasionally F#, though F# is not officially supported) within the SQL Server process. This code can be called as stored procedures, triggers, scalar functions, table-valued functions, aggregate functions, and even user-defined types. This has the ability to execute T-SQL within the calling session, even if there's an active transaction (i.e. true in-process execution).
External Scripts (language extensions) is newer than SQLCLR and is not .NET-specific. Languages that can be used are: R, Python, Java, and most recently C#. This code can only be executed via the sp_execute_external_script stored procedure; there is not option to call these external scripts via a function. Hence, there is no concept of per-row execution. These scripts are executed by a separate service (i.e. external), hence there is no option for in-process T-SQL code execution (meaning: executing T-SQL via an external script will connect as a separate session).
Additional details can be found in my post:
SQLCLR vs SQL Server 2017, Part 8: Is SQLCLR Deprecated in Favor of Python or R (sp_execute_external_script)?