SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Problem with Execute SQL task populating an XML re
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

griffster
Starting Member

United Kingdom
3 Posts

Posted - 04/13/2012 :  10:31:27  Show Profile  Reply with Quote
I'm trying to populate an XML result set from an execute sql task which I then use to populate a HTML page. The SQL involved using for xml auto works fine in ssms but I can't get it to work in SSIS 2008. The only clue is that, when I click on build query in the execute SQL task it states "The EXEC SQL construct or statement is not supported." I initially populated the SQL query from a variable but it stated something along the lines of "Compound queries are not allowed". I tried converting the SQL command therefore to a stored procedure and attempted to call that from the Execute SQL task but with the above result.

My execute sql task has:

ResultSet = XML
ConnectionType = OLE DB
SQLSourceType = Direct input
SQLStatement = EXEC [dbo].[sp_GetSSISPackageLog] @executionid = ?

And in parameter mapping:

Variable= System::ExecutionInstanceGUID
Direction = Input
Data Type = NVARCHAR
Parameter Name = 0
Parameter Size = -1

Any ideas where I'm going wrong please?

I see IsQueryStoredProcedure is False but also grayed out for some readon, if that's any indication.

visakh16
Very Important crosS Applying yaK Herder

India
47054 Posts

Posted - 04/13/2012 :  12:24:11  Show Profile  Reply with Quote
this is a good article to understand how to use options while calling stored procedure from ssis

http://www.julian-kuiters.id.au/article.php/ssis-execute-sql-task-output-parameters

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

griffster
Starting Member

United Kingdom
3 Posts

Posted - 04/16/2012 :  04:36:41  Show Profile  Reply with Quote
I don't think it's the syntax within the Execute SQL task that may be the problem. I've tried changing the text to execute dbo.dp_GetSSISPackageLog ? and I still get the syntax error "The EXEC SQL construct or statement is not supported.". Am I not able to put stored procedures with IF statements in them in to execute sql tasks? I suspect though it's more the "for xml auto, elements, type, root('SSISPackageLog')" statement in the stored procedure that may be the cause. Is this not allowed?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47054 Posts

Posted - 04/16/2012 :  11:43:42  Show Profile  Reply with Quote
Am I not able to put stored procedures with IF statements in them in to execute sql tasks?

do you mean IF statements inside procedure or are you trying to conditionally call procedure using if statement inside execute sql task command ?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000