Werner Raath
Werner Raath

Reputation: 1492

MS SQL Server 2019 export db from commandline

I need to export data from my MS SQL Server 2019, but I need to do so from the command line.

How can I achieve this? What are the best practices for exporting schemas?

As per comments below, I wanted to just use the mdf file but was encouraged not to.

Upvotes: 1

Views: 4858

Answers (1)

Yaniv Etrogi
Yaniv Etrogi

Reputation: 36

Use the bcp command line utility that allows for exporting data to flat files from tabular. The utility is part of the sql server setup and is available on your system

https://learn.microsoft.com/en-us/sql/tools/bcp-utility?view=sql-server-ver15

Upvotes: 1

Related Questions