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

SSIS Package - CSV file Row Count check with Destination Table count Expand / Collapse
Author
Message
Posted Tuesday, August 5, 2014 3:08 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 15, 2014 7:09 AM
Points: 5, Visits: 22
Hi All,

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

Everything Works fine.

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..
Post #1599518
Posted Tuesday, August 5, 2014 3:12 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:41 AM
Points: 5,101, Visits: 11,902
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.

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.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1599520
Posted Tuesday, August 5, 2014 4:05 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Yesterday @ 12:16 AM
Points: 752, Visits: 1,323
so this means your CSV is multiline if im not mistaken ?
Post #1599546
Posted Tuesday, August 5, 2014 4:21 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:41 AM
Points: 5,101, Visits: 11,902
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.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1599559
Posted Tuesday, August 5, 2014 6:33 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 15, 2014 7:09 AM
Points: 5, Visits: 22
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....



Post #1599653
Posted Tuesday, August 5, 2014 6:34 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 15, 2014 7:09 AM
Points: 5, Visits: 22
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....
Post #1599655
Posted Tuesday, August 5, 2014 6:34 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 15, 2014 7:09 AM
Points: 5, Visits: 22
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....
Post #1599656
Posted Tuesday, August 5, 2014 6:35 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 15, 2014 7:09 AM
Points: 5, Visits: 22
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....
Post #1599657
Posted Tuesday, August 5, 2014 8:46 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Yesterday @ 12:16 AM
Points: 752, Visits: 1,323
you can use the SSIS Script component to use this line of code.

Check this Link

hope it helps
Post #1599760
Posted Tuesday, August 5, 2014 8:49 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Yesterday @ 12:16 AM
Points: 752, Visits: 1,323
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.
Post #1599764
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse