Import Excel that does not have standard for SQL SERVER with C#

Asked

Viewed 62 times

1

I have the following scenario: I have an Excel spreadsheet that is provided by several private companies. This spreadsheet contains social security data. The problem is this: I have columns that refer to company data and columns that refer to the participant; the problem is that the name of the columns that refer to the company are the same names that refer to the participant, the only point that distinguishes this separation between the two is a grouping made by a header as shown below: Planilha exemplo I need to insert into the sql server database but the sheets can come with the order of the columns changed, which makes it difficult to insert the data into the table by position. Does anyone know how to enter the data correctly in the bank without putting the company values in the participant and vice versa?

  • The analysis of the first row of the header is enough to treat the columns correctly. It is to be solved by programming in C# or T-SQL?

  • In this case I will do in c#, but a solution by T-SQL would also be interesting

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.