I have a large amount of data in a excel sheet which has about 2000 rows. I have imported the table in sql server with no error.
I have to modify the excel now and update the same changes in the database also.
I cant delete the table and import again since i have large amount of data and have extra columns added to it.
So Please help me how to update the new values along with the existing values. I use C#.Net.
Thanks
Import into a temp table and then use the MERGE statement to update your master table.
Related
Explanation: I have an excel file that will be placed into a folder every day. There is normally about 5-7 worksheets inside that excel file. Each worksheet has the same column schema. I have an ssis package that extracts the data into a table and runs a procedure to several more columns of derived data to the original in the table. After the data has been added to the table i need to export it out into the excel file (Which will be the final complete report).
The ssis package has to For-Each Loops. One to loop through the excel files. and one inside that to loop through the sheets in the file. My initial idea was that i could just load straight from the database table back into the original excel file and overwrite all the data existing in there. Only problem is there is more columns in the table than can be mapped to the excel spreadsheet (because it originally only contains the 7 before the procedure is run). I have looked into dynamic excel creation but this seems over complicated for something that should be able to just be overwritten.
The process will work one sheet at a time, extract the data, build the extra data in the table, export the entire table back to the excel file. Rinse and repeat for the next several sheets in the excel file.
What would be the best approach for Reloading the data from the table back into the excel spreadsheet WITH the new columns also. Is dynamic excel sheet creation best for this? Or is there a better way to remap new columns to the existing spreadsheet and just add in the new data?
Thanks for the help in advance.
Currently I am working on Excel sheet module of XXX project.
I need to optimize performance of Excel record insert and update because they have millions of record with very complex condition and many cell applying different formula.
So my problem is that which one is faster insert record with create new excel sheet or in edit mode insert record on already created xyz excel template.
Right now I am using NPOI plugin for creating excel file.
I am using sqlite to create a Database with table which has to be just like the csv file along with the headers and data.
what is the best way to create a table in the sqlite database with schema and data from the .csv file.
can i avoid writing the script for the CREATE table?
Thank you in advance!!
I've used SQL Server Import and Export Wizard in the past for creating simple tables from a file. It can automatically detect data types and create the table.
http://technet.microsoft.com/en-us/library/ms141209.aspx
I have a table in SQL table name- Master which have Million of records and have Child1.txt file which have data. I have to remove the data from Master table which are not present in Child1.txt file. I am able to do it using import Child1.txt to temporary table and use left join.
The Problem is when I get Multiple .txt files eg. Child1.txt, Child2.txt, Child3.txt - Maximum allowed is 3 text file. The solution I came across is to use bulk insert by creating a temporary table and import all the 3 text files and compare with the master table.
I wanted to know if there was any other feasible solution to work on ????
I have one Excel sheet, in that plenty amount of data is there, so need to write these data in the SQL server table directly. I searched in google but I didn't found a proper solution for my requirement.
My Excel contains the data in row wise, I mean that data is not continually provided. Having sub headings & some other information about tables description written after every table ended.
I hope you all understand my requirement. Please anybody have idea about this issue, or alternate solution to resolve. Have to store this excel data in to the SQL server table.
Here data is columns as rows & rows as columns. So how to read in this case.
firstname vijay vikram vikek varun
lastame kumar rathod goshal kandari
mobile 45425 456546 54656 454615
Like above my data in excel sheet so how capture this kind of data.
Did you try using a excel interop.Using interop you can even read particular cells.You can read values by specifying a range and build a datatable or list.
These links may help
http://sandeep-aparajit.blogspot.in/2008/08/how-to-read-excel-in-c.html
C#: Getting a cell's value with Excel.interop
If you want to insert data into db directly, without front-end functionality, then you can do it by using SSIS packages or import functionality available in SQL server
I have tried importing data from excel to sql server table. The process is in sql server right click on particular database and under tasks tab select import data option then select source excel file and destination table. It's working fine for me.
Thanks
Venkat