Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 SQL task Rowset Need to Return One Row to Variable

Author  Topic 

Grifter
Constraint Violating Yak Guru

274 Posts

Posted - 2013-08-13 : 04:56:36
Hi

At one point in my data flow I have a sql task with the following SQL running:

select distinct convert(varchar(12),(datename(month, appointment_date)))	
FROM dbo.MyTable


This returns one row as my data filters for one Month. So I have an SSIS variable of nvarchar type and in the sql task I have the following settings:

ResultSet: Full result Set/single row
Connection type: ole db
Connection: My Connection to SQL
SqlSourceType: Direct Input
SQLStatement: As above
BypassPrepare: False

I have mapped the variable in my parameter mapping as an input variable where the value will be passed into that variable. If I use either single row set or full result set I get the following error:

quote:
Error: 0xC00291E2 at Find Appointment month, Execute SQL Task: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_Rowset".


I am not sure if i need to do something with the result set or expression settings in my sql task, because currently I only have the variable in the parameter mapping as input, is this correct if I want to pass the value returned from the sql to the variable?

Thanks

G

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-08-16 : 14:21:55
as i see you dont need any parameter in here as query has no parameters present. You need to map the resultset to variable in Results tab. Also if there are multiple values the variable should be of type object

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -