I have a sql file which has a lot of insert statements (1000+),
e.g.
insert into `pubs_for_client` (`ID`, `num`, `pub_name`, `pub_address`, `pub_tele`, `pub_fax`, `pub_email`, `publ_website`, `publ_vat`, `pub_last_year`, `titles_on_backlist`, `Personnel`) values('2475','2473','xxx xxx xxx','xxx xxx, xxxx, xxxx, xxxx, ','000000 ','0000 ',NULL,NULL,NULL,NULL,NULL,NULL);
My client wants these in an excel file.
Is it possible to extract the information from this sql file and import it into an excel spreadsheet? I'm using excel 2007.
Method Number 1 – Copy Grid results and paste into Excel After ensuring results to grid turned on, Execute your query, right-click the top left-hand corner of the results grid. Right-click on the database you want to export from. Then Select tasks and “Export Data”. The SQL Server Wizard will startup.
On the External Data tab, in the Export group, click Excel. In the Export - Excel Spreadsheet dialog box, review the suggested file name for the Excel workbook (Access uses the name of the source object). If you want, you can modify the file name. In the File Format box, select the file format that you want.
If you have a mysql installation somewhere and phpMyAdmin, just import the .sql file and export the table as .xls file directly from within phpMyAdmin.
edit: If you want to extract the data from the Insert statements without actually running them, you could:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With