Friday, February 24, 2012

How i Read the data from MS-Excel and insert into Sql-server table

Hi All,

I have one excel file the format is some thing like this->

These are the column name of the excel file

Avg. Stop Time by Customer-->> AMERICAN WOODMARK CORP MASTERBRAND CABINETS PANASONIC SIEMENS ACUSON WHIRLPOOL/QUALITY EXPRESS

All the column have Some Numeric value.

And i have Sql-Table Look like this->

FacilityCode ModeID VariableCode ByParamCode ParamValue WeekNumber WeekStart ActualValue CreateDate CreateBy LastUpdatedDate Comment

In this table we have column "ActualValue" that need to get the value from the Excel sheet

Like-

Avg. Stop Time by Customer AMERICAN WOODMARK CORP-Actual Value

Avg. Stop Time by Customer MASTERBRAND CABINETS--Actual Value

Avg. Stop Time by Customer PANASONIC--Actual Value

Avg. Stop Time by Customer SIEMENS ACUSON--Actual Value

Avg. Stop Time by Customer WHIRLPOOL/QUALITY EXPRESS--Actual Value

But the problem i have is How i read the data from Excel because they not in same column

Example->

Avg. Stop Time by Customer-->>

AMERICAN WOODMARK CORP

Are 2 different column and i want the value of AMERICAN WOODMARK CORP and store in the "Actual Value" column in table.

May you show us SQL SELECT command ?

No comments:

Post a Comment