• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1789
  • Last Modified:

ssis The Declare cursor SQL construct or statement is not supported.

i have a execute sql task, with the following query in the sqlstatement. but when i execute the task i get an error. The Declare cursor SQL construct or statement is not supported.

when i click on build query i get The Declare cursor SQL construct or statement is not supported.

it deletes my @date. is there a way around this.
DECLARE @date datetime
SET @date = (
                       SELECT extract_date
                          FROM Extract_Dates
                       WHERE extract_type = 'extract'
                       )

select ( '\\SERVER Extract_'

	+ CONVERT(VARCHAR,RIGHT(DATEPART(yyyy,@date),4))
	+ CASE WHEN LEN(CONVERT(VARCHAR,DATEPART(mm,@date))) = 1 
		  THEN '0' + CONVERT(VARCHAR,DATEPART(mm,@date)) 
		  ELSE CONVERT(VARCHAR,DATEPART(mm,@date)) END
+ CASE WHEN LEN(CONVERT(VARCHAR,DATEPART(dd,@date))) = 1 
		  THEN '0' + CONVERT(VARCHAR,DATEPART(dd,@date)) 
		  ELSE CONVERT(VARCHAR,DATEPART(dd,@date)) END
	+ '.xls')

Open in new window

0
aneilg
Asked:
aneilg
1 Solution
 
lcohanDatabase AnalystCommented:
I would try to put the code in a SP - build dynamic sql if needed inside the SQL SP and run it by using sp_executesql then run the SP in SSIS
0
 
Anthony PerkinsCommented:
There are some workarounds, but your best bet is to re-write without using a CURSOR.
0
 
aneilgAuthor Commented:
not fully answered
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now