我有一个存储过程,如下所示:
CREATE PROCEDURE [dbo].[sp_InsertPumpsStatus] (
@Frequency1 FLOAT,
@Power1 FLOAT,
@Db1 FLOAT,
@Efficiency1 FLOAT,
@Frequency2 FLOAT,
@Power2 FLOAT,
@Db2 FLOAT,
@Efficiency2 FLOAT,
@Frequency3 FLOAT = NULL,
@Power3 FLOAT = NULL,
@Db3 FLOAT = NULL,
@Efficiency3 FLOAT = NULL,
@Frequency4 FLOAT = NULL,
@Power4 FLOAT = NULL,
@Db4 FLOAT = NULL,
@Efficiency4 FLOAT = NULL,
@Frequency5 FLOAT = NULL,
@Power5 FLOAT = NULL,
@Db5 FLOAT = NULL,
@Efficiency5 FLOAT = NULL,
@Frequency6 FLOAT = NULL,
@Power6 FLOAT = NULL,
@Db6 FLOAT = NULL,
@Efficiency6 FLOAT = NULL,
@Frequency7 FLOAT = NULL,
@Power7 FLOAT = NULL,
@Db7 FLOAT = NULL,
@Efficiency7 FLOAT = NULL,
@Frequency8 FLOAT = NULL,
@Power8 FLOAT = NULL,
@Db8 FLOAT = NULL,
@Efficiency8 FLOAT = NULL,
@Frequency9 FLOAT = NULL,
@Power9 FLOAT = NULL,
@Db9 FLOAT = NULL,
@Efficiency9 FLOAT = NULL,
@Frequency10 FLOAT = NULL,
@Power10 FLOAT = NULL,
@Db10 FLOAT = NULL,
@Efficiency10 FLOAT = NULL,
@SolarDateTime NVARCHAR(20),
@Date DATETIME
)
AS
BEGIN
INSERT INTO [dbo].sp_InsertPumpsStatus
(
[Frequency1],
[Power1],
[Db1],
[Efficiency1],
[Frequency2],
[Power2],
[Db2],
[Efficiency2],
[Frequency3],
[Power3],
[Db3],
[Efficiency3],
[Frequency4],
[Power4],
[Db4],
[Efficiency4],
[Frequency5],
[Power5],
[Db5],
[Efficiency5],
[Frequency6],
[Power6],
[Db6],
[Efficiency6],
[Frequency7],
[Power7],
[Db7],
[Efficiency7],
[Frequency8],
[Power8],
[Db8],
[Efficiency8],
[Frequency9],
[Power9],
[Db9],
[Efficiency9],
[Frequency10],
[Power10],
[Db10],
[Efficiency10],
[SolarDateTime],
[Date]
)
VALUES
(
@Frequency1,
@Power1,
@Db1,
@Efficiency1,
@Frequency2,
@Power2,
@Db2,
@Efficiency2,
@Frequency3,
@Power3,
@Db3,
@Efficiency3,
@Frequency4,
@Power4,
@Db4,
@Efficiency4,
@Frequency5,
@Power5,
@Db5,
@Efficiency5,
@Frequency6,
@Power6,
@Db6,
@Efficiency6,
@Frequency7,
@Power7,
@Db7,
@Efficiency7,
@Frequency8,
@Power8,
@Db8,
@Efficiency8,
@Frequency9,
@Power9,
@Db9,
@Efficiency9,
@Frequency10,
@Power10,
@Db10,
@Efficiency10,
@SolarDateTime,
@DATE
)
END
执行此过程时,出现错误:
无效的对象名称'dbo.sp_InsertPumpsStatus'
出什么问题了?
答案 0 :(得分:2)
Invalid object name 'dbo.sp_InsertPumpsStatus'.
在您的脚本中,可以清楚地看到,您为存储过程指定了与in表中的表相同的名称。确保在Insert语句上定义的表正确。如果正确,请为存储过程命名。