SQL Server2016 Getting Started

Basic operations and use the novice SQL Server, each operation can be carried out in Microsoft SQL Server Management Studio, you can also use SQL scripts. This note will focus on the specific recording mode of operation of the script.

1. Create a database

Key words created for create.

create database testdb
on primary (
name ='testdb',
filename='F:\testdb.mdf',
size=10MB,
maxsize=100MB,
filegrowth=5MB
)
log on (
name='testdb_log',
filename='F:\testdb.ldf',
size=10MB,
maxsize=100MB,
filegrowth=5MB
)

The first block of code master file definition database, the second block of code is defined log log.
name \ filename is the name; size of the original file size; each file maxsize growth step.

As shown above, after you click Run to create the database successfully!

2, modify and delete database

Modify keywords to alter, delete the keyword for the drop.
In the current you want to modify and delete databases, create queries, input command.

esec sp_helpdb testdb	//查看testdb数据库的属性。

Published an original article · won praise 0 · Views 9

Guess you like

Origin blog.csdn.net/qq_45647925/article/details/104825328