The database generates scripts with frameworks and data, and restores the database. The framework script

Source: Internet
Author: User

The database generates scripts with frameworks and data, and restores the database. The framework script
We certainly need to maintain or reconstruct the project. At this time, we need to face other people's systems. If our predecessor was a very careful person, he will prepare all the required information for you, but in case of a careless predecessor, it is hard to say that the most likely case is to have code, then there will be no more ...... as we all know, we need three items for software: code, documentation, and database. People tend to focus only on code implementation and ignore the other two items. The database is okay to say that after all, we will release them to the server, the document is hard to say, so remind the engineers to keep the document in mind. This is the case in this article-when it is organized and maintained, it is found that the database is not in the file, but generally there will be a framework script file, unfortunately, I don't even have a framework script here, so we need to back up or generate a new script. However, empty databases cannot complete the test, so we need a script file with data. The following describes how to successfully generate a script with a framework and data:
The correct process is as follows:
1. Find the database to be copied, right-click the task, and click Generate script,
2. Click "Next" twice to go to the "set script writing options" page, click "Advanced modification", click "type of data to be filled in the script", and select the Architecture and Data, click "OK" and click "Next ".

3. Finally, it is generated. To emphasize that we can set the storage location here, in case we cannot find the default folder of the system.



---------------------------------- Separation line --------------------------------------- the method for exporting the database framework and data is not only used to generate scripts, but also used to back up the database, let's take a look at the backup. how to restore the bak file to our local data.
Backup and Restoration:
Step 1: open our SQL Server, right-click the database option, and click Restore database.
Step 2: enter the name of the database to be restored in the target database column. Click the Browse icon to select the path for restoring the database backup file. Click OK and select the restore check box, click OK. In this way, our restoration is complete.



I hope this little knowledge will help you.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.