Click here to Skip to main content
13,145,568 members (45,262 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have large excel file where the number of column is varied how to save it in SQl server ??? help me....!!!
Posted 17-Jan-13 5:45am
Sergey Alexandrovich Kryukov 17-Jan-13 11:51am
Save what? Whole file? some data? what? What's the problem?
akhil tripathi 17-Jan-13 12:03pm
I want to save data in sql server
Sergey Alexandrovich Kryukov 17-Jan-13 12:26pm
You did not answer. What data?! Besides, what did you try?
akhil tripathi 18-Jan-13 0:05am
I hava Excel file on which columns varied depends upon the User.First row of excel contains column name and remaining row contains data and now the problem is that different user can upload different structure of excel e.g. variable number of columns with data.Now how I can save these type of excel in sql server
I answered how to model all the excel data in my answer.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I still cannot here a decent question.

So, just a hint:

You can have two tables: one table represents columns, so the number of columns is variable, as you can add/remove records to/from this table. This table carry no information about the cells under the column.

Another table could represent cells, each cell referencing its column from the table of columns. One of the attributes of the cell record would be a foreign key referencing a master key of the column table.

I ignored rows because you did not ask about them. More realistically, the number of rows are also variable, some can be empty, etc.

With rows, do the same as I described with columns; you would need to add a table or rows. The each cell can reference its row having an external key referencing the master key of the row table. So, each cell references its row/column pair. This is how relational model works.

This way, 3 database table will reproduce one "jagged" spreadsheet. Additionally, you can represent a set of spreadsheets, etc.

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

There is a full detailed video on YouTube just search. Excel to Sql Server

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100