Fetching records from Table using SSIS getting Error in Excute Sql Task
Hi, When I am using Execute Sql task with simple qry like select A , B from ABTable and then using this column in resultset as 0 and while iam connecting using OLEdb. Then I am using Sctipt Task to send mail from Script. But throwing eroor as follows : Error: 0xC00291E2 at Execute SQL Task, Execute SQL Task: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_Rowset". Abhay Sawant
November 11th, 2010 4:27am

I am assuming that the error is happening at execute sql task. How is the task configured? Ex:Result Set property set to "FullResult Set" and the variable used to save the result set should be object variable etc.Nitesh Rai- Please mark the post as answered if it answers your question
Free Windows Admin Tool Kit Click here and download it now
November 11th, 2010 4:32am

Hi Nitesh, I have Done Execute SQl Task edit part in Genera Tab Result Set Prperty to Full result set and connetion type OLE DB and Sql Source Type to Direct input and in Sql Statement Query like Select a,b from TableAB and ByParserPrepare to False. IN Result Set tab set 0 as user::A and 1 as user::B these variable declare previously. After then i have attached a Sql Task Script In there I have done changes as follows : In Script Tab Entrypoint to ScriptMain ReadonlyVariables to Nothing ReadWriteVariables to User::A,User::B in Edit Script Ihave writeen the code as to send mail from A as emailid and B as Message and others like smtp server and frommailid and Subject is hard coded in Vb code file and that file build succeed. Then after compile getting following Error : Error: 0xC00291E2 at Execute SQL Task, Execute SQL Task: There is an invalid number of result bindings returned for the ResultSetType: "ResultSetType_Rowset". Task failed: Execute SQL Task Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. SSIS package "Package.dtsx" finished: Failure. What should be the error please sujjest . Abhay Sawant
November 11th, 2010 5:22am

Abhay, you need to save the execute sql task's result in an object variable (variable of object datatype) and there should be only one ResultName-VariableName mapping as: ResultName : 0 and VariableName : Objvarname. This way you will save the result set to a object variable.Nitesh Rai- Please mark the post as answered if it answers your question
Free Windows Admin Tool Kit Click here and download it now
November 11th, 2010 5:33am

Hi Nitesh, After Cahnges to one restset name as o to user::A then it is passed Sql Script task but after that it through error as follows : SSIS package "Package.dtsx" starting. Error: 0x1 at Script Task: Cannot execute script because the script entry point is invalid. Task failed: Script Task Warning: 0x80019002 at Package: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. SSIS package "Package.dtsx" finished: Failure. Abhay Sawant
November 11th, 2010 5:39am

HI Nitesh, After I have done to Result Set Name to 0 to user::A then it is running without error but I my code i need 2 variables to send mail one is MailId and another Message for each user is different. in my scriptmain ihave written sendmail code and for accessing message and emailid i am using following code : str_To = Dts.Variables( "A").Value.ToString str_From = " ab@gmail.com" 'Dts.Variables("C").Value.ToString str_Message = Dts.Variables( "B").Value.ToString str_Subject = "Status of E-claims: " 'Dts.Variables("S").Value.ToString MailSend(str_To, str_From, str_Subject, str_Message) But how could I able to catch both the values from only one result set name as object.Abhay Sawant
Free Windows Admin Tool Kit Click here and download it now
November 11th, 2010 5:50am

Abhoy, if your execute sql task query returns you only single row then you can use "Single Row" as result set and save the result in 2 string variables as you were doing earlier. In that case you have to do 2 ResultName-VariableName mapping. In case your execute sql task query returns multiple rows then you have to use the object variable approach (as mentioned in my prev post) and once the result set is saved in an object variable, you need to iterate it (using a foreach loop) and fetch each mailid and message into string variable. Inside foreach loop you can use the script task.Nitesh Rai- Please mark the post as answered if it answers your question
November 11th, 2010 9:49pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics