在如果它炸彈或總是一些錯誤 - 任何幫助將非常感激。SQL Server 2000存儲過程沒有明顯的原因
CREATE PROCEDURE sp_LetsWork
(@MYID int, @ThisDate Datetime)
AS
SET NOCOUNT ON
DECLARE @intErrorCode int,
@QStartDate datetime,
@QEndDate datetime
SELECT @intErrorCode = @@ERROR
--DATEPART(mm, @ThisDate) BETWEEN 1 and 3 -- test both options
BEGIN
IF @ThisDate BETWEEN '01/01/' + CONVERT(VARCHAR(4), YEAR(@ThisDate))
AND '03/31/' + CONVERT(VARCHAR(4), YEAR(@ThisDate))
RunQuarter:
SELECT *
FROM qryAR
WHERE CID = @MYID
AND (paiddate >= @QStartDate
AND paiddate <= @QEndDate)
--ORDER BY paiddate ASC
GO
-- GOTO RunQuarter
END
GO
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO ErrHandler
RETURN 0
ErrHandler:
RETURN @intErrorCode
GO
老兄,你必須給我們個錯誤,如果你真的希望幫助... – 2011-03-25 17:13:20
如果導致錯誤? – Beth 2011-03-25 17:14:52
錯誤170:第35行;錯誤的語法附近) – Kris 2011-03-25 17:23:08