Scenario:
It is frequently asked question, I can read object type
variable by using For-each Loop in SSIS but How can I read the object type variable in
Script Task.
Solution:
Here is quick demo that will show you step by step approach to read Object Type variable in Script Task.
Step 1:
Create connect to your SQL Server and then use Query in
Execute SQL Task as given below and save the result set to VarObject Variable
that is object type variable.
Select 1 as ID, 'AAMIR' AS Name
Union All
Select 2 as ID, 'Raza' AS Name
Step 2:
Configure Script Task as shown in snapshots for your SSIS Package
Select the Script Language and Variable you need to use in Script Task
Add the Code as shown in snapshot to your Script task
Code that you see in snapshot added by me in Script task
using System.Data.OleDb;
OleDbDataAdapter A = new OleDbDataAdapter();
System.Data.DataTable dt = new System.Data.DataTable();
A.Fill(dt, Dts.Variables["User::VarObject"].Value);
// TODO: Add your code here
foreach (DataRow row in dt.Rows)
{
string ID;
string Name;
object[] array=row.ItemArray;
ID = array[0].ToString();
Name = array[1].ToString();
// I Declare both variables ID And Name as String, So I can show in Messagebox. You can Declare ID as INT and set the value and use
//However you want to use.
MessageBox.Show("ID Value="+ ID +" AND Name Value=" + Name);
Final Output:
Run your SSIS Package, It is going to Run Execute SQL Task in which it will load the Result Set to VarObject Variable and then inside Script task we are using VarObject variable to read values from and displaying them.
Demasiado bueno el post... gracias
ReplyDeleteThank you for excellent article.I enjoyed reading your blog!!
ReplyDeletePlease refer below if you are looking for best Civil and Mechanical courses in Coimbatore
AutoCAD training in Coimbatore | ArchiCAD training in Coimbatore|AutoCAD RCC Detailing training in Coimbatore|Ansys Workbench training in Coimbatore
Keep the good work and write more like this..
Thank you for delivering the great blog and keep doing...
ReplyDeleteLinux Training in Chennai
Linux Course in Chennai
Advanced Excel Training in Chennai
Oracle Training in Chennai
Job Openings in Chennai
Unix Training in Chennai
Tableau Training in Chennai
Oracle DBA Training in Chennai
Power BI Training in Chennai
Pega Training in Chennai
Spark Training in Chennai
Thank you so much for providing a good and descriptive post about SSIS.I genuinely feel this is the best way in which one can actually get to understand some crucial technicalities of SSIS.
ReplyDeleteSSIS Postgresql Write
Great blog !It is best institute.Top Training institute In chennai
ReplyDeletehttp://chennaitraining.in/devops-training-in-chennai/
http://chennaitraining.in/datastage-training-in-chennai/
http://chennaitraining.in/abinitio-training-in-chennai/
http://chennaitraining.in/pentaho-training-in-chennai/
http://chennaitraining.in/msbi-training-in-chennai/
http://chennaitraining.in/informatica-mdm-training-in-chennai/
It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
ReplyDeletehttp://chennaitraining.in/oracle-training-in-chennai/
http://chennaitraining.in/oracle-dba-training-in-chennai/
http://chennaitraining.in/odi-training-in-chennai/
http://chennaitraining.in/oracle-soa-training-in-chennai/
http://chennaitraining.in/teradata-training-in-chennai/
http://chennaitraining.in/informix-training-in-chennai/
http://chennaitraining.in/sybase-training-in-chennai/
http://chennaitraining.in/sql-server-dba-training-in-chennai/
This is an awesome post. Really very informative and creative contents. oracle training in chennai
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHI I am getting below error ,Not sure whats happening
ReplyDeleteobject is not an adodb.recordset or an adodb.record site:
Mua vé tại đại lý vé máy bay Aivivu, tham khảo
ReplyDeletegiá vé máy bay đi Mỹ khứ hồi
vé máy bay qn đi sg
vé máy bay đi hà nội tháng 6
vé đi nha trang giá rẻ
ve may bay di Hue gia re
thuê xe ô tô đi sân bay nội bài
combo du lịch đà nẵng tháng 7
If Oracle is your dream job, then we, Infycle, are with you to make your dream into reality. Infycle Technologies offers the best Oracle Training in Chennai, which offers various programs in Oracle such as Oracle PLSQL, Oracle DBA, etc., in the 200% hands-on practical training with specialized trainers in the field. Also, the mock interviews will be arranged for the candidates to face the interviews without any fear, and 100% placement assurance will be given here. To have the words above real, call 7502633633 to Infycle Technologies and grab a free demo to know moreBest Oracle Training in Chennai | Infycle Technologies
ReplyDeletetableau training
ReplyDeleteservicenow training
vmware training
tableau training
sccm training
mysql training
Lets have a look at a recent news item that is quite
ReplyDeleteentertainmentbee.com
themoviesbio.com
petrefine.com
Everything is going to be alright. Are we really being honest
ReplyDeletefrasesparaenamorarz.com
fras-es.com
punaisesdelit.org
groupe-sanguine.fr
meilleur-gps.fr
Infycle Technologies, the best software training institute in Chennai offers the leading Python course in Chennai for tech professionals, freshers, and students at the best offers. In addition to the Python course, other in-demand courses such as Data Science, Cyber Security, Selenium, Oracle, Java, Power BI, Digital Marketing also will be trained with 100% practical classes. After the completion of training, the trainees will be sent for placement interviews in the top MNC's. Call 7504633633 to get more info and a free demo.
ReplyDeleteInfycle Technologies, the top software training institute and placement center in Chennai offers the Best Digital Marketing Course in Chennai | Infycle Technologies for freshers, students, and tech professionals at the best offers. In addition to Digital Marketing, other in-demand courses such as DevOps, Data Science, Python, Selenium, Big Data, Java, Power BI, Oracle will also be trained with 100% practical classes. After the completion of training, the trainees will be sent for placement interviews in the top MNC's. Call 7504633633 to get more info and a free demo.
ReplyDeleteInfycle Technologies, the No.1 software training institute in Chennai offers the Selenium course in Chennai for tech professionals, freshers, and students at the best offers. In addition to the Selenium, other in-demand courses such as Python, Big Data, Oracle, Java, Python, Power BI, Digital Marketing, Cyber Security also will be trained with hands-on practical classes. After the completion of training, the trainees will be sent for placement interviews in the top companies. Call 7504633633 to get more info and a free demo.
ReplyDeleteGreat post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
ReplyDeletehow tall is dababy
henry sedgwick v
in conclusion alternatives
frank rocky fiegel
how to program rca universal remote
taylor olsen
zach and tori roloff
TalktoGiant
This is a very interesting post. Thank you for posting a lot of interesting post.
ReplyDeleteทางเข้าเล่น igoal
Board of Secondary Education, Andhra Pradesh, (BSEAP) Going to Conducts 6th, 7th, 8th, 9th, 10th Class Examination 2023, Every year more than 16 Lakhs of Students Appeared in this Exam, AP 6th, 7th, 8th, 9th, 10th Class Exam Dates Expected to be Announce Month of Soon. AP 8th Question Paper 2023 Students Alert this Time High School & Primary Schools Study Materials and Plans a Strategic Study Routine to Score well in the Exam.
ReplyDeleteI have been working on a project for the last day and all of the other examples I have been able to find online have not been able to lay it out in a way helpful to me. Your example of "SSIS - How To Read Object Type Variable In Script Task [Script Task SSIS]" gave me exactly what I needed, and wanted to thank you for that!!!
ReplyDelete