This article is a mirror article of machine translation, please click here to jump to the original article.

View: 8107|Reply: 0

SQL statement to Varchar type

[Copy link]
Posted on 4/13/2020 4:44:35 PM | | | |
Syntax:

CAST (expression AS data_type)

Parameter description:

expression: any valid SQServer expression.

AS: Used to separate two parameters, before AS is the data to be processed, and after AS is the data type to be converted.

data_type: The data types provided by the target system, including bigint and sql_variant, cannot be used with user-defined data types.

When using the CAST function for data type conversion, it can be accepted in the following cases:

(1) The data type of the two expressions is exactly the same.
(2) The two expressions can be implicitly converted.
(3) The data type must be explicitly converted.

If you try to make an impossible conversion (for example, to convert a char expression with letters to an int type), SQServer will display an error message.

If the length of the data type is not specified at the time of conversion, SQServer automatically provides a length of 30.
Code:






Previous:MyISAM is the difference between MySQL database storage engine and InnoDB
Next:Introduction to Web Services Enhancements (WSE) 3.0
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com