Mssql All Tables To Csv

• Bilgisayar

Mssql All Tables To Csv

An easy way to extract all table to csv or txt file in MSSQL is just run in SMSS and then copy sql result and run in cmd .

use database ;
SELECT 'bcp ' +
            + '.'
            + '.'
            + ' '+'out'+' c:\target\'
            + name + '.csv -w -t"|" -E -S '
            + @@servername
            + ' -T'
    FROM sys.objects
    WHERE TYPE='u'
        AND is_ms_shipped=0
        order by name

Copy all and run in CMD.

That is all+.