more fun in the life of a fledgling database developer.
Code:
USE [ClaytorsCottages]
GO
DECLARE @return_value int
EXEC @return_value = proc_NewReservation
@AvailID = 0,
@UserID = 8,
@Begin = 12/09/2011,
@End = 12/12/2011
SELECT 'Return Value' = @return_value
GO
Quote:
Msg 102, Level 15, State 1, Line 7
Incorrect syntax near '/'.
|
... I can not imagine what this thing thinks is wrong with the syntax of that date, and why the syntax of the second date is perfectly acceptable.
The Stored procedure looksa like this:
Code:
/****** Object: StoredProcedure [dbo].[proc_NewReservation] Script Date: 12/07/2011 20:58:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[proc_NewReservation]
@AvailID Int, @UserID Int,
@Begin DATE, @End DATE
AS
BEGIN
INSERT INTO tblGuestReservations (AvailID, UserID)
VALUES (@AvailID, @UserID)
END
BEGIN
UPDATE tblAvailableRooms
SET Reserved = 1, ResBegin = @Begin, ResEnd=@End
WHERE AvailID = @AvailID
END
I must say what the heck.