SQL Server 2012 Getting Started diagram: Building tables, backing up, restoring

Source: Internet
Author: User

SQL Server 2012 Getting Started diagram: Build table, Backup, restore _. NET Tutorial Network--Simple and professional. NET Technology Web site
Http://www.soaspx.com/dotnet/sql/sql2012/sqlserver212_20120504_9079.html

Author: Wang Yujie

Establish your first database and table

Example: Set up a database to describe a student's situation in a school. Name it school. and to establish a table student to save student information under the school database. In the visual interface, we typically do this. (This is an introductory tutorial that does not describe how to build a table with SQL statements)

1. After connecting to the local database engine, right-click the database and select New database.

2. In the popup dialog box, set the database name to school, and the other parameters remain the default.

3. Refresh the view to see that the school database has been established successfully.

4. Below we will create a new table in this database. Expand the School database, right-click Tables, and select New table.

5. The right window is the visual interface of the table, where you can design a table,

6. After completion, we need to set the ID as the primary key, indicating that it is a value that is not duplicated and is used to uniquely identify a record, which is critical for future data operations.

Once the settings are complete, the ID will have a small key icon in front of it. To set the primary key self-growth method is in the identity specification, in the IS identity, select Yes

7. When finished, press Ctrl+s to save the table, and the table name is student.

8. Refresh the view again to see that our student table has been established successfully.

Second, how to back up the database

For data security, we need to back up data on a regular basis. In SQL Server 2012, this is typically done. Note that the interface is slightly different from SQL Server2008. Take the school database as an example.

1. Right-click on the School database, select Task, Backup.

2. In the destination, select Add.

3. Select a location for the backup. You must have access to this location, or the backup will be an error.

(slightly mistaken, recommend adding a. bak suffix to the file)

3. When the add is complete, click OK to start the backup.

4. Backup completed successfully.

Third, how to restore the database

In SQL Server 2012, the interface for recovering a database is also different from what it used to be. To do this, take the backup file of the school database as an example.

1. Right click on the database folder and select "Restore Database"

2. Select "Devices" and add the school backup file to the list.

3. Check the database name and select Restore and click OK to start execution.

4. Successful restore.

Copyright Notice:

Visitors can use this homepage ( Http://www.cnblogs.com/wangshunli ) for personal learning, research or appreciation, and for other non-commercial or non-profit purposes,

at the same time, it shall abide by the provisions of the copyright law and other relevant laws and shall not infringe the legal rights of this homepage and the relevant rights holders.

before reprint, be sure to sign the author of this article and make a hyperlink to the content from this homepage, so as not to cause unnecessary trouble.

this article Wangshunli-Blog Park
e-mail: [email protected]

Disclaimer of this blog, copyright notice-wangshunli-Blog Park
Http://www.cnblogs.com/wangshunli/p/4341739.html

SQL Server 2012 Getting Started diagram: Building tables, backing up, restoring

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.