SQL Server's simple introduction to SQL Server versions is divided into:
① Enterprise Edition: Comprehensive
② Standard Edition: Suitable for SME needs
③ Workgroup Edition: The ideal data management solution for small businesses with unlimited size and number of users
④ Development: Covers all features of the Enterprise Edition, but only allows development and testing to be used, not allowed as a production system
⑤ free version:
SQL Server usage: connecting to a Database
A) Check whether the service is turned on:
Method One: Microsoft...à Configuration tool àsqlserver Configuration Manager à (left) SQL Server service Mssqlsepver or sqlexpress any connection to a
Method Two: Win+ràservices.mscà find Mssqlsepver or sqlexpress in any connection to a
b) Select login mode
Method One: Windows Authentication login
Server type: Database engine
Server Name: (Startup is SQLExpress). or the computer name or localhost.
(starting with Mssqlsepver). \SQLExpress or computer name \SQLExpress
Method Two: Login à login name: saà general à self-resetting password à ok ... à security à
See how SQL Server is validated
To set a constraint:
① Verify Length: Len (column name) >6
② value: Column name = ' value '
③ contains the value: Charindex (' value to include ', column name) >0
④ default value is today: getdate ()
Special judgment
① judgment null: IS NULL
Type conversions
Cast ()
Conver ()
Exporting data
Database right-click Task à export data
SQL statements
Query first few columns: SELECT Top 5 * from table name
Stored Procedures
Write stored procedure: create proc stored procedure name [parameter type [= Default] [Output]]
Call stored procedure: Execute (EXEC) stored procedure name [parameter value]
Delete stored procedure: drop proc Stored procedure name
Code Usage Database
- Java language:
① defining the connection string:
String con = "Data Source = server name; Initial catalog= database name; User id= users; pwd= Password "
② Creating Connection objects
SqlConnection conn = new SqlConnection (con);
③ Open the connection to the database:
Conn.Open ();
④ manipulate the database and close the connection:
Conn.close ();
Simple Introduction to SQL Server