0

I have an issue in importing data from Excel to SQL Server using SSIS

Issue is that everything works well but when i run the package again (supposingly to append more records in the table it shows error)

Could you let me know what I need to do? Do I need to configure my package again or set something on database ?

Here you see on the first run of the package

https://i.stack.imgur.com/ylNbX.jpg

Data have been imported correctly in the SQL

https://i.stack.imgur.com/LwDGi.jpg

But when run again it show this error, until I truncate the table.

https://i.stack.imgur.com/BX4T7.jpg

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Asim
  • 33
  • 1
  • 6

2 Answers2

0

basically Sqlite is a database which is used to save data.Android provides several ways to store user and app data. SQLite is one way of storing user data. SQLite is a very light weight database which comes with Android OS.

you can see this link here.which contains a code for import Exel sheet into sqlite dataBase.

and another code for that:

FileInputStream is = new FileInputStream("Excel File Path in SDCard");
HSSFWorkbook  wb = new HSSFWorkbook(is);
HSSFSheet sheet = wb.getSheet("Test");

Iterator<?> rowIterator = sheet.rowIterator();
int index = 0;
while (rowIterator.hasNext()){

     HSSFRow hssfRow = (HSSFRow) rowIterator.next();
      if(index++ != 0){

         //In this stage i have storing each cell into database
          util.inserrDataToSqliteDb(dbManager, hssfRow.getCell(1).getStringCellValue(),


hssfRow.getCell(2).getStringCellValue()  
    }
 }

which is serioslly helps me when i need that one and see this link

Community
  • 1
  • 1
John smith
  • 1,781
  • 17
  • 27
0

The reason of my error was because i didn't have primary key, after I use primary key then i can upload any records using SSIS package, and they will by default append to the actual table.

Thanks for help.

Asim
  • 33
  • 1
  • 6