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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 SQL task Rowset Need to Return One Row to Variable
 Reply to Topic
 Printer Friendly
Author  Topic Next Topic  

Constraint Violating Yak Guru

274 Posts

Posted - 08/13/2013 :  04:56:36  Show Profile  Reply with Quote

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:

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?



Very Important crosS Applying yaK Herder

52326 Posts

Posted - 08/16/2013 :  14:21:55  Show Profile  Reply with Quote
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
Go to Top of Page
   Topic Next 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.02 seconds. Powered By: Snitz Forums 2000