SQL Server Basic functions

Source: Internet
Author: User

1. String function length and analysis

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 start position, length is the string length, the actual application of Len (expression) to obtain its length
3,right (char_expr,int_expr) returns the int_expr character to the right of a string , with the opposite of left
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

SQL Server Basic functions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.