SQL Server Basic Functions
SQL Server Basic functions
1. String Functions length and analytical use
1,datalength(char_expr) Returns a string that contains the number of characters, but does not contain subsequent spaces
2,substring(expression,start,length) takes a substring, the subscript of the string is from "1", start is the starting position, length is a string, and the actual application islen (expression)get its length
3,right(char_expr,int_expr) returns the int_expr character to the right of a string and Lefton the contrary
4,isnull( Check_expression, Replacement_value)if Check_expression is empty, returns the value of Replacement_value, NOT NULL, returns the Check_expression character action class
5,sp_addtype Self-defining type
For example: EXEC sp_addtype Birthday, datetime, ' NULL '
6,set nocount {On|off}
Causes the returned results to contain no information about the number of rows affected by the Transact-SQL statement. If some of the statements contained in a stored procedure do not return much of the actual data, this setting can significantly improve performance because of the significant reduction in network traffic. Set NOCOUNT settings are set at execution or runtime, not at parse time.
When SET NOCOUNT is on, no count is returned (indicating the number of rows affected by the Transact-SQL statement).
when SET NOCOUNT is OFF, the count is returned
This article is from the "sunnyting" blog, make sure to keep this source http://sunnyting.blog.51cto.com/8814143/1559586
SQL Server Basic functions