Hello, there is xls list which looks like this

Table http://take.ms/10y3C

and there is a sql table in this format,

SQL code http://take.ms/qHHwI

Is there a way to transfer data from xls table to sql machine? The location of the table is the same as it should be in sql.

  • Directly sql can not read xls. In the context of high-level languages ​​c # c ++ php python - there are libraries that allow you to import xls. But some, for example, mssql allow you to receive data from oledb or odbc sources (if there is a driver for excel on servers, it is often not available), or to connect external libraries and load data through the library (which is not sql principle). - nick_n_a February
  • Specify what means you want to do, and what is the size of the tables. Manually you want to convert or automatically, if automatically what technologies languages ​​you want to use. - nick_n_a February

3 answers 3

Yes, there is such an opportunity.

Excel allows you to save data in CSV format. And most SQL databases support loading data from CSV files. The syntax itself varies depending on the specific implementation of the database, but there is such a possibility.

Well, as an option - CSV is a plain text format. You can always make the simplest script that will form SQL code based on it.

  • Your "manual" option is hardly suitable. - nick_n_a
  • @nick_n_a something tells me that for the author of the question the "manual" option is copy-paste from Excel to SQL queries. And therefore, any speeding up of the process is automatic. - newman
  • If this is a one-off option - then it’s better to use the integrate function to get sql right away :) - nick_n_a

MS Excel can also be accessed using SQL queries from code on VB.Net or C #, that is, if I understand correctly, read the data in one place and write to another place, although it is not entirely clear about the formats of links about which you speak up Alternatively, if you have MS Access, you can import data from Excel into Access and then export it to SQL Server.

  • Do not rush to write the answer. Your answer looks like a clarification, and is not a quality one. Wait for a reputation of 10 points and you can leave comments. - nick_n_a February

If there are not many records, you can form an INSERT command by concatenating the values ​​of the table, but in this case, you must first create this table and describe the fields. The line will look something like this: = CLICK ("insert into MyTable values ​​("; A1; ","; B1; ","; C1; ")")