Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Destination data checking


Destination data checking

Author
Message
farooq.hbs
farooq.hbs
SSC-Enthusiastic
SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)

Group: General Forum Members
Points: 115 Visits: 194
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.
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16447 Visits: 13202
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 SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
farooq.hbs
farooq.hbs
SSC-Enthusiastic
SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)

Group: General Forum Members
Points: 115 Visits: 194
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
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16447 Visits: 13202
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 SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
farooq.hbs
farooq.hbs
SSC-Enthusiastic
SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)

Group: General Forum Members
Points: 115 Visits: 194
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.
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16447 Visits: 13202
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 SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
farooq.hbs
farooq.hbs
SSC-Enthusiastic
SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)SSC-Enthusiastic (115 reputation)

Group: General Forum Members
Points: 115 Visits: 194
It is not taking the second file.. And it is not inserting the file name too.
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16447 Visits: 13202
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 SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search