we are in the process of the project must do maintenance or refactoring, when we have to face is someone else's system, if the predecessor is more careful of the person is OK, he will all the information needed to prepare you, but in case of careless predecessor's words is not good to say, the most likely situation is the code, And then there's no more ...We know that we do the software needs three items: code, documents and databases, often people only focus on the implementation of the Code and ignore the other two, the database is OK after all, we will publish to the server, the document is hard to say, so remind the vast number of engineers, be sure to keep the document in mind. This is how this article came about-when it was sorted to maintain a system and found that the database is not in the file, but in general there will be a framework of script files, but unfortunately I do not have a framework script here, so we need to back up or generate a new script. But the empty database cannot be tested, so we need a script file with the data. Here's how the database generates scripts with frames and data successfully:
The correct process is as follows :
1. Find the database you want to copy, right click to select Task, click Generate Script,
2, click two times next, go to the Settings scripting Options page, Click on Advanced changes, click on the "type of data to fill in the script", select the schema and data, click OK, Next Step
3, the last is generated, emphasize a point, here we can set the location of the store, in case we can't find the system default folder.
----------------------------------Divider Line------------------------------------- The way to finish exporting the database framework and data is not only to generate scripts, but also one way is to back up the database, as far as the backup method is not done in detail, we look at how the backup good. bak files are restored to our local data.
Backup restore:
First step: Open our SQL Server, right click on database options, click Restore Database
The second step: Fill in the Target database column we need to restore the database name, click the Browse icon to select the path we want to restore the database backup file, click OK and then tick the Restore check box, and then click OK. So our restoration work is done.
I hope this little knowledge can help everyone.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Database generates scripts with frames, data, and restore databases