Common SQL Server Functions

Source: Internet
Author: User

1. CONVERT () function

?

1 CONVERT (data_type (length), data_to_be_converted, style)

Data_type (length) specifies the target data type (with an optional length ). Data_to_be_converted contains the value to be converted. Style specifies the output format of the date/time.

Available style values: Click to open the link

2. DATEADD () function

Click Open Link

3. CAST () function

?

1 2 Syntax for CAST: CAST (expression AS data_type [(length)])

Expression

Any valid expression.

Data_type

Target data type. This includes xml, bigint, and SQL _variant. The alias data type cannot be used.

Length

An optional integer that specifies the length of the target data type. The default value is 30. CONVERT () function and CAST () function details: Click to open the link

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.