0

how can u backup the data in your db to a csv using sql?

19th Mar 2016, 2:35 PM
Lloyd Mwaluku
Lloyd Mwaluku - avatar
3 Answers
+ 3
>sqlite3 database.sqlite sqlite> .headers on sqlite> .mode csv sqlite> .output backup.csv sqlite> SELECT * FROM tablename; sqlite> .quit
28th Feb 2019, 12:34 PM
ŠŠ½Š“рŠµŠ¹ Š§Š°Ń‡ŠøŠ½, Andrew Chachin
ŠŠ½Š“рŠµŠ¹ Š§Š°Ń‡ŠøŠ½, Andrew Chachin - avatar
+ 1
when your query is fulfilled, you can save as CSV format. you would want to view query as "grid".
30th Mar 2016, 8:22 AM
Rakesh Joshi
Rakesh Joshi - avatar
+ 1
bcp database.schema.tablename | out 'filename .csv'
16th Apr 2016, 8:57 AM
Jonathan Baynes