SQL Server Basic Learning 1-Introduction

Source: Internet
Author: User

I. Introduction of the Database

Database: Divided into hierarchical type, network type, relational type. Now it's usually a relational type. SQL Server is a large database software that is used to manage and modify databases. DB DBMS (Database management System) DBS (database system).

The mainstream database: Sqlserver,oracle,db2,sybase,access,foxpro

SQL language-internationalization standard. Transaction-sql,pl-sql

Ii. classification of documents in the database

1, MDF master data file, contains the database startup information, each database must have a master data file.

2, LDF data files, these files can not be placed with the master data file all the data, if the main data file may contain all the data of the database, then the database does not need a secondary data file. The secondary data file can have more than one.

3, NDF log file, used to save the recovery database log information.

Each database has at least two files, one master data file, and one thing log file.

Third, the SA account activation

1. In Object Explorer, right-click the. Object, select Properties, select "Security" on the left side of the Properties dialog box and select "SQL Server and Windows Authentication" on the right side

2. Set the login password for the SA.

3. Enable the SA account.

4. Restart the service.

Iv. backup and restore of data

Start by backing up the database with the following steps:

1) put the mouse in the select the database you want to back up, right-click on the "task"-"Backup";

2) Click OK, pop up the Backup Database window, under Backup type, select Copy backup only, select Backup expiration, add target backup to location, and click OK. 3) Popup dialog: Prompt the backup has been executed successfully.

Restores:

After the backup is complete, delete the data and restore the original database.

1) The first method: Put the mouse in a database you want to restore right-click, select "Task"-"Restore-database";

The second method: (in the case of the deletion of the database) put the mouse in the "database" right-click---"Restore the Database"; 2) the "Restore Database" window appears, the target database is the name of the database you want to restore, specify the location of the source device where the specified backup occurs, and click OK. 3) A restored backup set, select only copy backed up database, 4) Popup dialog box: Prompt restore completed successfully. If the following dialog box appears, the restore did not complete successfully.

2, attach, separate is the database

Separation:

1) in a database that you want to detach, right-click on "Task"--"detach" 2) to eject the Detach Database window and click OK.

3) Move the detached data elsewhere (as long as it is not in the original disk database folder)

Additional:

1) Back to the database management platform, right-click on "Database"--"Attach"

2) pop up the "Attach Database" window, select the database you want to attach, and click OK. 3) After attaching, under Object Explorer, locate the appropriate database.

V. Import and export of data

Begin

Guide Excel to the database

Data source is Excel

Target is the database

SQL Server Basic Learning 1-Introduction

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.