Execute SQL Task error with parmeters?

I have a query to populate a table with a insert statement, runs fine in the database, runs fine with variables as a stored proc, does not work in a execute sql task.

The query works FINE in the execute sql task if I only map paramter 1. Paramter 1 + 2, parameter 1+2+3, parameter 1+2+3+4.... any additional parameter it FAILS. The paramter that is being mapped is a globally scopped variable 'add_value (long)' that is set to 0 then incremented by 1 in a for loop. Parameter naming is 0, 1, 2 ,3 etc.

Query (if I replace the '?' with a variable, it works perfectly well in tsql)

INSERT INTO All_dates
(dt_key, current_month_ind, date, current_search_year_ind, year, month, month_desc, fiscal_year, search_year, holiday_flg, holiday_desc, drop_desc)
VALUES
(CAST(CONVERT(varchar, GETDATE() +?, 112) AS int),
0,
CAST(CONVERT(varchar, GETDATE() +?, 112) AS datetime),
0,
DATEPART(yyyy, GETDATE() +?),
DATEPART(mm, GETDATE() +?),
DATENAME(month, GETDATE() +?),
DATEPART(yyyy, GETDATE() +?),
DATEPART(yyyy, GETDATE() +?),
'N', NULL, NULL)

Sql to create the table:

CREATETABLE All_dates(dt_keyintNOTNULL,current_month_indintNOTNULL,datesmalldatetimeNOTNULL,current_search_year_indintNULL,yearintNOTNULL,monthintNOTNULL,month_descvarchar(50)NOTNULL,fiscal_yearintNOTNULL,search_yearintNULL,holiday_flgvarchar(1)NOTNULL,holiday_descvarchar(20)NULL,drop_descvarchar(50)NULL)

[4004 byte] By [Stefbauer] at [2007-12-25]

SQL Server

Site Classified