【发布时间】:2014-08-23 12:24:57
【问题描述】:
我正在编写一个将在 Access 中调用的 SQL 存储过程。我的 sp 将传递四个数据字段(BatchID、InstrumentName、FileName、QueueId)。然后它将一条记录插入到表中(tblinstrumentInterfaceLog)。到目前为止,这是我的代码:
CREATE PROCEDURE upInsertToInstrumentInterfaceLog @BatchID int, @InstrumentName nvarchar(60), @FileName nvarchar(60), @QueueID int
INSERT INTO tblInstrumentinterfaceLog (batchId,Instrumentname,"Filename",QueueID,DateOfBatch,folder)
VALUES (@batchid,@InstrumentName,@FileName,@QueueID,@getdate(),'New')
GO
我相信我的格式正确,但我收到两个错误:
Msg 156, Level 15, State 1, Procedure upInsertToInstrumentInterfaceLog, Line 2
Incorrect syntax near the keyword 'INSERT'.
Msg 137, Level 15, State 2, Procedure upInsertToInstrumentInterfaceLog, Line 3
Must declare the scalar variable "@QueueID".
为了确保可能没有数据类型问题,我查看了 tblInstrumentInterfaceLog 的架构,这似乎与我初始化每个的方式相匹配。
如果他们发现此存储过程存在问题,可以告诉我
【问题讨论】:
标签: mysql sql sql-server stored-procedures