1 Enter the following command to start, stop, or pause services from the SQL Server command line.
The SQL Server command line is as follows:
Start SQL Server
NET START MSSQLSERVER
Pausing SQL Server
NET PAUSE MSSQLSERVER
Restarting a paused SQL Server
NET CONTINUE MSSQLSERVER
Stop SQL Server
NET STOP MSSQLSERVER
2. Create a database
Create database with SSMS CREATE DATABASE (visualize) in SQL Server any visual behavior is performed in the background as a SQL statement T-sqluse master;--use the primary database Database name on (name=n ' logical name ', filename=n ' path \ filename. mdf ', SIZE=10MB,FILEGROWTH=1MB) log on (name=n ' logical name _log ', filename=n ' path \ FileName _ Log.ldf ', size=10mb,filegrowth=10%); go--Go is not the fame in the SQL statement, he is the notification database will execute the preceding statement script in conjunction with the use database name;
3. Create a table
Use database, CREATE table schema name. Table name (field 1 type 1 NOT null or NULL, field 2 type 2 NOT NULL or NULL, field 3 Type 3 NOT NULL or null,...); Go-> how the data in the table describes the string type char (number) ASCCII code character, fixed-length character if the length of the input data is not enough to fill the end of the space char (1) char (10) 123,456,789,012,345 Advantage, You do not need to consider the calculation disadvantage when inserting data, occupy the resource nchar (number) Unicode character set, the structure is consistent with char nchar (10) is 10 Unicode characters position 1.,234,567,890,123,46e,+19 varchar (number) ASCCII encoded, using variable lengths, as long as the number is not more than the varchar (1NVARCHAR) text and ntext storage large text data (in future SQL Server no longer support) varchar (max) and nvarchar (max ) Supplement: The maximum length of char and varchar in the standard is 8000 byte standard nchar and nvarchar maximum length is 4,000 characters but varchar (max) is not the same as nvarchar (max)
SQL Server Basic Operations