Skip to content

asolovey/SQLServer-CSV-dump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dump SQL Server Table to CSV File

This script requires python3 and pip3.

Installation

Use pip3 -r requirements.txt to install dependencies.

Usage

Run ./sql2csv.py --help to see command-line options.

To dump the whole table, use

    ./sql2csv.py --server='xx.xx.xx.xx\INSTANCE' \
    --db='DATABSE'        \
    --user='DOMAIN\USER'  \
    --password='PASSWORD' \
    --table='TABLE'       \
    --output='table.csv'

If a subset of the table is required, provide optional --where='....' clause. Note that proper shell quoting is required if where clause contains spaces or special symbols such as <, >, ".

For example:

    ./sql2csv.py ...other options... --where='name <> "foobar"'

About

Dump SQL Server Table to CSV File

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages