Home > Software design >  How can I export a SQL Server database in *.sql format?
How can I export a SQL Server database in *.sql format?

Time:01-03

The system I am working on needs to create data dumps in SQL format. Is there a built-in way (like the mysqldump tool) to create this with SQL Server?
I am working specifically with Azure SQL Edge in a container on a Mac or on Linux.
This is not a production system, no need to be super performant.

If this is not possible, is there any other simple way to share small pieces of my database, as files?

The desired result of such a dump would be a simple text file (not CSV, nor *.bak or similar)

insert into table a.A
values
(v,v,v,v,v),
(v,v,v,v,v),
....
....
....
(v,v,v,v,v);

insert into table a.b
values
(v,v,v,v,v),
(v,v,v,v,v),
....
....
....
(v,v,v,v,v);

One of the purposes is educational, which is why readable SQL format is preferable.

CodePudding user response:

All suggestions redirect you to installing SSMS and creating a .sql file but if I'm not wrong you are using MacOS or Linux.

In this case I suggest you to install DbVisualizer which is available for MacOS or Linux and do the same thing.

  • Related