January 10, 2011 at 9:07 pm
I have created a SSIS package with SQL Task1--->DataFlow Task--->SQL Task2---->.
Task Functionality as follows:-
1. SQL Task1, i am creating a table (if it does not exist in database)
2. DataFlow Task, i am reading a xml file and loading the data into above created table.
3. SQL Task2, i am updating the records in the table.
They are few more operations performed after that.
The normal execution form is going from 1-3-so-on. But when i run the package it executes DataFlow Task first, hence throws the error stating table or view does not exist. It picks the "2nd one" first which is not desired.
I have even tried setting up Precedence (execute DataFlow Task only after successfull execution of SQL Task1)through:-
1. In Control Flow --> Add Precedence Contraint
2. In Package Explorer ---> Precedence Contraint
Even after setting up the Precedence, every time when i run the package, it picks the "DataFlow Task" first instead of SQL Task1.
Please guide me how can solve this problem.
January 11, 2011 at 12:54 am
You should post the exact error messages, it would really help us to help you.
My first guess is that the package fails in validation. Try setting the DelayValidation property to False for the dataflow.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
February 9, 2011 at 4:57 am
Hi ,
I have suggestion for this senario.
You are not able to insert the record by using oldeb destination.
Step:1 you rae creating a table by uisng execute sqltask.
Step:2 then you use DT to extract data from xlm and insert the extract data into cretaed table in the sqltask.Here itself you face error.because when you try to map the destination table it wont be there.so your are not a\even run the package with out any error.
My suggestion
step:as you said create a table by using execute sql task
step:2 use the data flow task and insert the extracted data into one record set
Note:you have declare a variable with the data type of object.
Step:3 Come to control flow and drag and drop the for each loop container and select the ADO.net enumerator.Inside the for each loop container drag and drop the execute sql task and write a insert query just pass the values through a varaible.
Ex: Create table test1(column1 varchar(10)) ---Sql task
I have taken a flat file connection manager and set the file path ..In that file i have only one data ...it is "HI", i want to insert the "Hi" into the table test1.
drag the record set destination i have updated the variable which is having the data type of object.
Then foreach loop inside for each loop[ i have sqltask. In that i have written a query as insert into test1 (column1) values (?).
February 9, 2011 at 5:06 am
pmm.sudarsan:
It is much easier to just set the DelayValidation property of the dataflow to TRUE.
This way, validation will wait until the dataflow starts running. By that time, the table is created by the Execute SQL Task and there will be no problem.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
February 9, 2011 at 9:29 am
Thanks Koen (da-zero) & pmm.sudarsan for sharing suggestions.
Actually i found another way which solved my problem. I made use of sequence containers and grouped logical related tasks together. The containers were placed in the sequence i wanted the flow to go and it worked.
February 9, 2011 at 11:01 am
Gr8 let me try this
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply