SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSIS Package - CSV file Row Count check with Destination Table count


SSIS Package - CSV file Row Count check with Destination Table count

Author
Message
mathews.subbu
mathews.subbu
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 156
Hi All,

I have developed one SSIS package to import the CSV file values into DB table.

Everything Works fine.w00t

But i need some other workflows to CHECK the CSV file row counts with Destination table counts for confirmation to check whether i m pulling correct number of rows..


Pls Can Any one help me???? Have been stucked at this..
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)

Group: General Forum Members
Points: 51252 Visits: 21155
mathews.subbu (8/5/2014)
Hi All,

I have developed one SSIS package to import the CSV file values into DB table.

Everything Works fine.w00t

But i need some other workflows to CHECK the CSV file row counts with Destination table counts for confirmation to check whether i m pulling correct number of rows..


Pls Can Any one help me???? Have been stucked at this..


What do you want to check, exactly?

Number of rows in file vs number of rows imported?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
twin.devil
twin.devil
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5292 Visits: 2692
so this means your CSV is multiline if im not mistaken ?
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)SSC Guru (51K reputation)

Group: General Forum Members
Points: 51252 Visits: 21155
twin.devil (8/5/2014)
so this means your CSV is multiline if im not mistaken ?


When would you have a non-multiline CSV? Wouldn't that just be column headings without data?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
mathews.subbu
mathews.subbu
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 156
Hi ,

My CSV file looks like this..

Name,Number,Dept
Subbu,7,IT
Babu,6,CSE

So After i inserted this CSv file into My DB table ..the Table ll show only two records in it.(As per the input file).

Manual Solution:

This i can know by just doing the following Manner:

Open input CSV file in a notepad --> go to last record--> and check the count of the rows in the CSV
file(in our case it is 2 rows) , then checking the Count with DB table count(count(*) from releavant table)..

This can be done easily..

AUTOMATED SOLUTION:

But I WANNA AUTOMATED solution where i can get the CSV file count to my mail ..saying that


Your today CSV file count is 5.
Your DB table Count is also 5.(This can be done by counting the records with a where conditon)

So,The SSIS Import is success.

Else (if mismatches)

The SSIS Import is not success.

Can anyone say how this can be done in SSIS ?? Pls help....
mathews.subbu
mathews.subbu
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 156
Hi ,

My CSV file looks like this..

Name,Number,Dept
Subbu,7,IT
Babu,6,CSE

So After i inserted this CSv file into My DB table ..the Table ll show only two records in it.(As per the input file).

Manual Solution:

This i can know by just doing the following Manner:

Open input CSV file in a notepad --> go to last record--> and check the count of the rows in the CSV
file(in our case it is 2 rows) , then checking the Count with DB table count(count(*) from releavant table)..

This can be done easily..

AUTOMATED SOLUTION:

But I WANNA AUTOMATED solution where i can get the CSV file count to my mail ..saying that


Your today CSV file count is 5.
Your DB table Count is also 5.(This can be done by counting the records with a where conditon)

So,The SSIS Import is success.

Else (if mismatches)

The SSIS Import is not success.

Can anyone say how this can be done in SSIS ?? Pls help....
mathews.subbu
mathews.subbu
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 156
Hi ,

My CSV file looks like this..

Name,Number,Dept
Subbu,7,IT
Babu,6,CSE

So After i inserted this CSv file into My DB table ..the Table ll show only two records in it.(As per the input file).

Manual Solution:

This i can know by just doing the following Manner:

Open input CSV file in a notepad --> go to last record--> and check the count of the rows in the CSV
file(in our case it is 2 rows) , then checking the Count with DB table count(count(*) from releavant table)..

This can be done easily..

AUTOMATED SOLUTION:

But I WANNA AUTOMATED solution where i can get the CSV file count to my mail ..saying that


Your today CSV file count is 5.
Your DB table Count is also 5.(This can be done by counting the records with a where conditon)

So,The SSIS Import is success.

Else (if mismatches)

The SSIS Import is not success.

Can anyone say how this can be done in SSIS ?? Pls help....
mathews.subbu
mathews.subbu
Valued Member
Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)Valued Member (59 reputation)

Group: General Forum Members
Points: 59 Visits: 156
Hi ,

My CSV file looks like this..

Name,Number,Dept
Subbu,7,IT
Babu,6,CSE

So After i inserted this CSv file into My DB table ..the Table ll show only two records in it.(As per the input file).

Manual Solution:

This i can know by just doing the following Manner:

Open input CSV file in a notepad --> go to last record--> and check the count of the rows in the CSV
file(in our case it is 2 rows) , then checking the Count with DB table count(count(*) from releavant table)..

This can be done easily..

AUTOMATED SOLUTION:

But I WANNA AUTOMATED solution where i can get the CSV file count to my mail ..saying that


Your today CSV file count is 5.
Your DB table Count is also 5.(This can be done by counting the records with a where conditon)

So,The SSIS Import is success.

Else (if mismatches)

The SSIS Import is not success.

Can anyone say how this can be done in SSIS ?? Pls help....
twin.devil
twin.devil
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5292 Visits: 2692
you can use the SSIS Script component to use this line of code.

Check this Link

hope it helps
twin.devil
twin.devil
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5292 Visits: 2692
Phil Parkin (8/5/2014)
twin.devil (8/5/2014)
so this means your CSV is multiline if im not mistaken ?


When would you have a non-multiline CSV? Wouldn't that just be column headings without data?


what is actually meant was this i-e

Code, Name, Amount
01,item1,100
02,"item
,123",10


this becomes multiline CSV.
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