对象名称包含超过最大数量的前缀.最大值为 3 [英] The object name contains more than the maximum number of prefixes. The maximum is 3

查看:36
本文介绍了对象名称包含超过最大数量的前缀.最大值为 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的存储过程正在尝试将记录写入另一台服务器上的数据库.声明如下:

My stored procedure is trying to write a record in to a database on another Server. The statement is here:

IF @Builds > 0
   BEGIN
        SET @DPU = @Failures / @Builds
        INSERT INTO SQL05.ManufacturingPortal.dbo.OPC.WriteRequests (ID, RegisterID, Value, RequestedDate, IsCompleted)
        VALUES(@PLCID, 'F8:10' , CAST(@DPU AS NUMERIC(10,2)), GETDATE(), 0)    
    END 

但是,当我尝试创建存储过程时 - 我收到以下错误:

However when I try to create the stored procedure - I get the following error:

对象名称SQL05.ManufacturingPortal.dbo.OPC.WriteRequests"包含的前缀数超过最大数量.最大值为 3.

The object name 'SQL05.ManufacturingPortal.dbo.OPC.WriteRequests' contains more than the maximum number of prefixes. The maximum is 3.

我尝试创建 Server.DB.DBO 的别名来缩短前缀的数量,但似乎实现了这个错误.

I have tried creating an alias of Server.DB.DBO to shorten the number of prefixes however seem to be implementing this wrong.

我无法更改目标数据库上的数据库架构.关于如何解决这个问题的任何建议?

I cannot change my database schema on the target database. Any suggestions on how I can get around this?

谢谢

推荐答案

正确的四部分表名称是 server.database.schema.tablename - 你有一些多余的部分.

Correct four-part table name is server.database.schema.tablename - you have some excess parts there.

看起来表名是 OPC.WriteRequests?如果是,则必须使用方括号:SQL05.ManufacturingPortal.dbo.[OPC.WriteRequests]

Looks like table name is OPC.WriteRequests? If yes, then you have to use brackets: SQL05.ManufacturingPortal.dbo.[OPC.WriteRequests]

但也许您只是名称的某些部分不正确?

But maybe you just have some part of name incorrect?

这篇关于对象名称包含超过最大数量的前缀.最大值为 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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