开发者

using scalar function output in an update

开发者 https://www.devze.com 2023-01-18 22:15 出处:网络
Suppose I have a 2 column table with columns (arg, value) and a user-defined functi开发者_如何学JAVAon foo.

Suppose I have a 2 column table with columns (arg, value) and a user-defined functi开发者_如何学JAVAon foo.

Is there a way to have an update query that goes through the table and calls foo with argument arg and sticks the results in column value for every row in the table?


Assuming SQL Server the syntax is

Update YourTable
SET value = dbo.foo(arg)

It is often more efficient to not use scalar UDFs for Row by Row processing however. What is the scalar UDF doing?

0

精彩评论

暂无评论...
验证码 换一张
取 消