T
T
theSever2018-11-20 18:53:50
SQL
theSever, 2018-11-20 18:53:50

How to convert sql to xls without raising the server?

There is a long unloaded table with data in sql format, how can it be quickly overtaken in csv Excel or xls, so that quickly, without fuss with raising the server and import / export ten times?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AVKor, 2018-11-20
@AVKor

Parse the SQL dump and write the resulting data to a CSV file.

S
Sumor, 2018-11-20
@Sumor

I understand that you have a file with lines of the form (INSERT INTO ...).
It is better, of course, to execute it on the database from which you created it and import it from there.
There are intermediate options, but they may not work for one reason or another. It all depends on what you have.
Here's some food for thought:
Excel and CSV files have their own odbc drivers. You can create an xls file (xslx or csv). Then connect it to any database query tool that supports ODBC. And in this tool, execute your file with INSERT lines. It is only necessary to transform it in order for it to work (names of tables, columns, etc.).
The MSSQL import/export tool can connect to an ODBC source, including an xls or csv file, and execute a query there.
Modern versions of Excel incorporate advanced database tools. You can connect from it to the file as a data source and execute your SQL file in one form or another.
All options, except for execution on the database, will most likely require some preparation / reformatting of the source file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question