export table mssql

2 Apr
  1. Click the Windows “Start” button. Enter “cmd” into the text box and press “Enter”. This opens the Windows command line.
  2. Type the following code to export your table to a CSV file:

    bcp database.dbo.customer out customer.csv /Uuser /Ppassword /ScustomerServer /c /t

    In this example, the customer table is exported to the “customer.csv” file. The “user” and “password” are the values used to access the server. “CustomerServer” is the name of your database server.

  3. Press “Enter” to execute your bcp command. It may take several minutes to export to the CSV file, depending on the size of your table.