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 2005 Forums
 SSIS and Import/Export (2005)
 SQL task Rowset Need to Return One Row to Variable
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Grifter
Constraint Violating Yak Guru

263 Posts

Posted - 08/13/2013 :  04:56:36  Show Profile  Reply with Quote
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

India
52317 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
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
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.05 seconds. Powered By: Snitz Forums 2000