vendredi 22 juillet 2016

GETDATE scalar variable

I'm retrieving a must declare scalar variable error for @StartFixtureDay but not sure what I need to do or see the problem with my code:

CREATE PROCEDURE [dbo].[Date_Insert]

AS
SET NOCOUNT ON
BEGIN

DECLARE @StartFixtureDay DATE
SET @StartFixtureDay = CAST(GETDATE() AS DATE)

    ;WITH League_Dates AS (
...
 SELECT rn,
           week_number,
           DATEADD(day, week_number - 1, @StartFixtureDay) AS WeekNumber,
...

...

EXEC [dbo].[Date_Insert] @StartFixtureDay

Aucun commentaire:

Enregistrer un commentaire