How to dump an entire SQL Server 2014 database into a file, to be imported into a Postgres database?

后端 未结 2 383
情深已故
情深已故 2021-01-24 11:29

I have a SQL Server 2014 database from which I need to dump just the table data (no indexes, stored procedures, or anything else).

This dump needs to be imported into a

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-24 12:02

    Microsoft recently announced a new command line tool mssql-scripter (it's open source and multi-OS) that allows you to generate T-SQL scripts for databases/database objects as a .sql file. The announcement is here.

    Once launching the scripter you'll want to run a command similar to the following:

    $ mssql-scripter -S serverName -U userName -d databaseName --data-only

    More details are on the GitHub page usage guide: https://github.com/Microsoft/sql-xplat-cli/blob/dev/doc/usage_guide.md

提交回复
热议问题