简体   繁体   English

我在存储过程中调用表值函数,但出现错误:无效的对象名'FnFoBoSec'

[英]I'm calling a table-valued function within a stored procedure, but I get an error : Invalid object name 'FnFoBoSec'

ALTER PROCEDURE BorBsec
    (@sec NVARCHAR(30))
AS
    SELECT * 
    FROM FnFoBoSec(@sec)

When executing this procedure, I get this error: 执行此过程时,出现以下错误:

Msg 208, Level 16, State 1, Procedure BorBsec, Line 9 消息208,第16级,状态1,过程BorBsec,第9行
Invalid object name 'FnFoBoSec' 无效的对象名称“ FnFoBoSec”

You must use the schema prefix when calling a function in T-SQL. 在T-SQL中调用函数时, 必须使用架构前缀。

Try to change your code to this: 尝试将您的代码更改为此:

ALTER PROCEDURE BorBsec
    (@sec NVARCHAR(30))
AS
    SELECT * 
    FROM dbo.FnFoBoSec(@sec)
         *****

Of course, if your function should have been created in a different schema (other than the default dbo schema), then you must replace that with the actual schema prefix. 当然,如果您应该在其他模式 (默认的dbo模式除外)中创建函数,则必须使用实际的模式前缀替换该函数。

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

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