Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

OELDB Source, Query from Variable does not like the SQL Variable declared

$
0
0

Good day,

I am storing SQL in a Variable to be used in a OLEDB Source, the query works in SQL SSMS but when selecting the variable in oledb source, it gives me error the Variable @Month must be declared

"DECLARE @Month INT= @[User::MonthNumberInt]
IF(@Month > 1)         
BEGIN        
	   select 2 as KeyCompany
END
ELSE
BEGIN
	   select 1 as KeyCompan
END"

Please help?

Regards


Viewing all articles
Browse latest Browse all 24688

Trending Articles