How to export database in Microsoft SQL Server Management Studio — WebnerSolutions

Webner Solutions
3 min readMar 17, 2021

--

How to export database in Microsoft SQL Server Management Studio — Webner Solutions
How to export database in Microsoft SQL Server Management Studio — Webner Solutions

Problem: When we use Microsoft Management Studio to export the database, by default it will export the database schema only. When I was trying to export the database to import it into my other local machine, I faced this issue. I selected to export the database in a SQL file. But when I imported it then it imported the database schema only. When I checked the file, it contained the schema only.

Solution: To resolve this problem, follow these steps:

  1. After Opening Microsoft SQL Server Management Studio, select your database then right-click on it and choose the option Tasks>>Generate Scripts…
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
  1. It will open the Generate Script Information Window. Click on the Next button to start:
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
  1. Now in the Choose Objects dialog box, you can choose whether you want to script the entire database or specific database objects:
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
  1. ClickNext
  2. Now, you will see the Set Scripting Options dialog box so here choose the second option Save as script file option and select the path where you want to store your file. Then click on the Advanced tab:
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
  1. In the Advanced Scripting Options dialog box when you will scroll down in the General section, you will see Types of data to script field and it will have the default value as Schema only:
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
  1. This is a dropdown box and you will need to choose the option Schema and data:
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
  1. And this is the hack 🙂
  2. Now, after clicking on the Next button, you will see the selected option on the Summary dialog box so click the Next button:
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
  1. And on the final dialog box, you can see the progress result for all your database tables. Finally, click on the Finish button and you are done.
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions
How to export database in Microsoft SQL Server Management Studio — WebnerSolutions

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Originally published at https://blog.webnersolutions.com on March 17, 2021.

--

--

Webner Solutions
Webner Solutions

Written by Webner Solutions

Our team in Salesforce is very strong, with in-depth knowledge of Salesforce classic and Lightning development as well as the Service cloud.

Responses (1)