0
嘗試創建存儲過程時出現錯誤。我試圖弄清楚,但現在經過一段時間後,我決定問。微小維護計劃的存儲過程中的錯誤
這裏是我的SP代碼:
ALTER PROCEDURE [dbo].[sp_maintenance]
AS
begin
dbcc checkdb('BD_Farmacia')
GO
ALTER INDEX ALL ON Artigo
REBUILD
GO
GO
ALTER INDEX ALL ON Categoria
REBUILD
GO
GO
ALTER INDEX ALL ON Composicao
REBUILD
GO
GO
ALTER INDEX ALL ON Iva
REBUILD
GO
GO
ALTER INDEX ALL ON Linha_venda
REBUILD
GO
GO
ALTER INDEX ALL ON Lote
REBUILD
GO
GO
ALTER INDEX ALL ON Utente
REBUILD
GO
GO
ALTER INDEX ALL ON Venda
REBUILD
GO
end
RETURN
這裏的錯誤消息:
Msg 102, Level 15, State 1, Procedure sp_maintenance, Line 8
Incorrect syntax near ')'.
Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'RETURN'.
有人能幫忙嗎? 謝謝 Chiapa
那好吧,我該怎麼辦?我必須刪除/插入什麼代碼才能工作? – chiapa
刪除SP中的所有'GO'。同樣去除'RETURN'結尾,你不需要它。 –