Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Destination data checking Expand / Collapse
Author
Message
Posted Wednesday, November 21, 2012 5:06 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, May 14, 2014 7:43 AM
Points: 106, Visits: 174
Hi,
Destination (OLE DB) has two table with existing data. (table1 : Person with Bonus and Table2: Person without bonus)

The requirement is i want to insert the data from Excel source to these above table (OLE DB) Destination,
Before inserting i want to check if the data (Specifically person Id) which i'm gonna insert is already exists or not,
If Exists (Person), then i should not insert the duplicate data
If Exists (personId)but there is some updation , then i should update the particular record.

Please help on this. how to perform the above funtionalilty.

Below is the data flow my package

Excel Source (3 files) to UNION all task(To union all the 3 files data) to Sort Task(To sort the data ascendingly) to Aggregate ( Sum the metric values using group by person Id)
To Conditional Split( Perons Id with Bonus and Person Id without Bonus) to Ole db Destination.
Post #1387366
Posted Thursday, November 22, 2012 12:04 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 10:26 AM
Points: 13,359, Visits: 10,223
You can use a Lookup component to check if the record exists in the destination or not.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1387733
Posted Thursday, November 22, 2012 1:58 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, May 14, 2014 7:43 AM
Points: 106, Visits: 174
Thanks for the reply.

The table has the row with person Id 204
The PersonId 204 row is updated with bonus to without bonus(Say 10 to 15)..
I want to update the particular row but the person id is already present in the destination.
If i use lookup task then it will not update the particular row.

Let no know if there any task for ths plz
Post #1387759
Posted Thursday, November 22, 2012 2:46 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 10:26 AM
Points: 13,359, Visits: 10,223
With the Lookup task you will check if the person with ID 204 is already in the destination or not.
If it is, you retrieve the bonus column (call it bonus_dest). Then you compare it with the bonus column of the source in a conditional split. If the values are the same, you don't need to do an update. If they are different, you need to do the update with an OLE DB Command.

Be aware that the OLE DB Command executes a SQL statement for every row, so it is really slow for large datasets.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1387787
Posted Monday, November 26, 2012 4:39 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, May 14, 2014 7:43 AM
Points: 106, Visits: 174
Hi guys,

I have many excel files in the folder. I want to insert the data of all these files into tables with the excel files name.

I create a package with Foreach loop container with data flow tsk into it with varibles defininf the files name.
Variables:
Name : FileName
Scope : Package
Datatype : String.
Value : E:\Farooq\SSIS data Sources ( In this folder there are multiple excel files)

I added derived column task to the flow and in the derived column, i used this varible but i'm not getting proper result and it is throwing error.
Added to this, I configured the excel expression properties as
Excel File Path : @User::FileName

I'm not getting the desired result.
Please help me on this.
Post #1388527
Posted Monday, November 26, 2012 4:49 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 10:26 AM
Points: 13,359, Visits: 10,223
What is the error?



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1388531
Posted Monday, November 26, 2012 4:57 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, May 14, 2014 7:43 AM
Points: 106, Visits: 174
It is not taking the second file.. And it is not inserting the file name too.
Post #1388537
Posted Monday, November 26, 2012 6:02 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 10:26 AM
Points: 13,359, Visits: 10,223
I mean the actual error description. The one that shows in the output tab in BIDS.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1388569
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse