SQL Server database Operations

Source: Internet
Author: User

--Create a database
Create DATABASE Online test system
On
(
Name= Online examination System _data,
Filename= ' E:\DB\ online exam system _data.mdf ',
SIZE=5MB,
MAXSIZE=20MB,
filegrowth=5%
)
Log On (
Name= Online examination System _log,
Filename= ' E:\DB\ online exam system _log.ldf ',
SIZE=2MB,
MAXSIZE=10MB,
Filegrowth=1mb
)

Use [Online examination system]
GO
ALTER DATABASE online examination system
Add File
(
Name= Online examination system _DATA1,
Filename= ' E:\DB\ online exam system _data1.mdf ',
Size=2mb
)

Execution Result:

--View Current database status (single line comment)

/* Multiple lines
Comments */
Select DATABASEPROPERTYEX (' Online exam system ', ' status ')
As ' current database state '

Results:

--Delete Database

Drop DATABASE Online Exam system

SQL Server database Operations

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.