SQL Server Notes - Basic Concepts 1

1.USE <DatabaseName> //Select database

  Example: USE [master] //master is the system default database

2. When the field or table name is the same as the reserved word or keyword, it needs to be added.

3. COMPATIBILITY_LEVEL is used to set the compatibility level of SQL Server.

  例:ALTER DATABASE DatabaseName SET COMPATIBILITY_LEVEL = 100

  ps: 80, 90 and 100 represent SQL Server 2000, SQL Server 2005 and SQL Server 2008 respectively.

4. FULLTEXTSERVICEPROPERTY ( property )       -- Returns information about the properties of the full-text engine.

5.DECLARE @var_name var_type //Declare variables and initialize variables separately

 SET @var_name = xx

6. Although all Transact-SQL statements are valid within a BEGIN...END block, some Transact-SQL statements should not be grouped in the same batch or statement block.

7. Before calling EXECUTE with a string, validate the string. Never execute commands constructed from unvalidated user input.

8. When storing strings in variables, sometimes N is added before the strings, where N represents the Unicode universal code.

  In the unicode character set, a character is two bytes . The encoding methods are UTF-8, UTF-16, UTF-32. 

Microsoft's official website has online documentation for Transact-SQL, which can be said to be very friendly.

https://docs.microsoft.com/zh-cn/sql/t-sql/language-reference

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326842785&siteId=291194637