爲什麼我的程序給我:不正確的語法在程序
Msg 156, Level 15, State 1, Procedure CountAantalModules, Line 10
Incorrect syntax near the keyword 'AS'.
,當我試圖改變它?
USE [SomaData]
GO
/****** Object: StoredProcedure [dbo].[CountAantalModules] Script Date: 08/04/2011 15:09:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[CountAantalModules]
(
@prodorder as int,
@result int output
)
AS
SET NOCOUNT ON;
SELECT @result = COUNT(ORD.ORDERNUMMER) AS AantalModuleOrders
FROM Kostenposten AS KP
INNER JOIN Orders AS ORD ON ORD.Ordernummer = KP.Ordernummer
WHERE ((KP.KPNR = '170' AND KP.SOORT='LadeFront' OR KP.SOORT='GlasLadeFront') OR
(KP.KPNR = '250' AND KP.SOORT='LadeFront')) AND ORD.PRODUCTIEORDER = (@prodorder)
這是他的輸出變量,那麼或許應該刪除該別名,而不是變量賦值 –
@Derek,非常真實的,我已經更新了答案。 – jzd