|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, February 10, 2011 2:16 AM
Points: 2,
Visits: 29
|
|
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.
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 6:51 AM
Points: 9,372,
Visits: 6,470
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, January 08, 2013 6:46 PM
Points: 16,
Visits: 36
|
|
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 (?).
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 6:51 AM
Points: 9,372,
Visits: 6,470
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, February 10, 2011 2:16 AM
Points: 2,
Visits: 29
|
|
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.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, January 08, 2013 6:46 PM
Points: 16,
Visits: 36
|
|
|
|
|