In interview i have faced this questions please help me to resolve the queries

Posted by Sudheep.Grandhe under Sql Server on 1/23/2015 | Points: 10 | Views : 1141 | Status : [Member] | Replies : 2
Hi Team,

I had attended a interview.In interview i have faced this questions please help me to resolve the queries.

1.We have 5 csv files,how can send data from csv files to single destinations.


2.We have 10 csv files in the folder,file names are having 6 letters lenth,first two letters represents the country code like US,UK.. and next two letters having like numerics like 10 to 99 and next two letters represents quarters like Q1,Q2,Q3,Q4.totally file name like UK44Q2.csv


3. How can validate the file name should be in same order or not,if file name not in the same order then it will be give an error.


4. How can develop this scenario.


àscenario


In ssis package if we load 1000 records in to destination, then how can u send mail to project lead that mail containing information like 1000 records loaded or 2000 records loaded like that depend up on no of records loaded.

5.we have 10 csv files ,how can store the file names in to table

6.How to eliminate invalid characters for transfer data from txt file to sql table?

Regards,
Sudheep.G.

Best,
Sudheep.



Responses

Posted by: Bandi on: 1/23/2015 [Member] [MVP] Platinum | Points: 25

Up
0
Down
1.We have 5 csv files,how can send data from csv files to single destinations

you can loop through all CSV files in a folder by using FOR EACH LOOP

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Sudheep.Grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 1/23/2015 [Member] [MVP] Platinum | Points: 25

Up
0
Down
2.We have 10 csv files in the folder,file names are having 6 letters lenth,first two letters represents the country code like US,UK.. and next two letters having like numerics like 10 to 99 and next two letters represents quarters like Q1,Q2,Q3,Q4.totally file name like UK44Q2.csv

How can validate the file name should be in same order or not,if file name not in the same order then it will be give an error. ?

Answer:
1. Get file name while processing/looping through files
2. use expressions to check for file name validation as per your conditions
3. Assign true/false for a variable @FileNameValidated based on the file name validation
4. If @FileNameValidated == True then process through the CSV file further; else prompt/log the error saying that 'FileName is INVALID'


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Sudheep.Grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response