How to import SQL Server database into sql file

2. Solution

(1) Use the generate script function to export the database sql file

(2) Click Next

(3) Click "Select specific database objects". Then take the next step.

If you want to export all, check in front of the table, and if you want to export part of it, check in front of the specific table.

(3) Turn on advanced mode

This advanced mode is critical , if you want to export all the contents of the database, then select "Schema and Data" after "Types of data to script". The default is the schema. If it is not set, the exported sql file will have no data.

(4) "File Name" Here you can set the save location and saved file name. Then take the next step.

It's best to set it up here, otherwise the exported file will be inconvenient to find.

(5) Click Next

(6) Click Finish

At this point, exporting the database as a sql file is complete.

Guess you like

Origin blog.csdn.net/weixin_45467975/article/details/131245618