About 23,800,000 results
Open links in new tab
  1. SQL Server CAST() Function - W3Schools

    Aug 25, 2017 · The CAST() function converts a value (of any type) into a specified datatype. Tip: Also look at the CONVERT() function. Syntax

  2. SQL Server CAST Function By Practical Examples

    Mar 14, 2019 · Summary: in this tutorial, you will learn how to use the SQL Server CAST() function to convert a value or an expression from one type to another. Let’s see the following query: It returns 2 as a number: In this statement, SQL Server implicitly converts the character string '1' to the number 1.

  3. CAST and CONVERT (Transact-SQL) - SQL Server | Microsoft Learn

    Sep 3, 2024 · These functions convert an expression of one data type to another. Transact-SQL syntax conventions. Any valid expression. The target data type. This includes xml, bigint, and sql_variant. Alias data types can't be used. An optional integer that specifies the length of the target data type, for data types that allow a user specified length.

  4. How to Use CAST Function in SQL? - SQL Knowledge Center - SQL

    Feb 9, 2024 · Mastering the CAST function in SQL has empowered me to manipulate and transform data with precision. Through practical examples, I’ve shared how to seamlessly convert data types, from varchar to integer and date types, enhancing the versatility of …

  5. SQL Server CAST() Function - GeeksforGeeks

    Feb 13, 2024 · The CAST() function in SQL Server is a versatile tool for data transformation tasks. By understanding its usage and syntax, you can seamlessly convert data between different types to suit your specific needs.

  6. SQL CAST Function Explained with Examples - Database Star

    Jun 2, 2023 · The SQL CAST function is quite powerful, but it can be hard to use. Learn how to use it and what it can do in this article. This article applies to Oracle, SQL Server, MySQL, and Postgres.

  7. SQL CAST () Function: An Overview - LearnSQL.com

    Dec 3, 2024 · The SQL CAST () function converts one data type to another. This article discusses what the function is for, and when and how you’d use it. In relational databases, every column has a defined data type that controls what kind of data is …

  8. Learn SQL CAST Function with Examples and Alternatives

    Feb 1, 2022 · In this tutorial, we’ll dive a bit deeper into the CAST function which can be used in a SQL database with T-SQL scripts, SELECT statements and stored procedures. The SQL Server CAST syntax is as follows: For example, if we want to cast a Boolean value from the bit data type to a tiny int data type, we can do it with a valid expression such as:

  9. SQL CAST Function in SQL Server – Syntax, Examples, and Best …

    Mar 31, 2025 · The CAST function in SQL Server is a built-in function used for explicit data type conversion. It converts a value from one data type to another, overriding SQL Server’s automatic (implicit) conversions. This allows developers to ensure data consistency and …

  10. CAST - SQL Tutorial

    Nov 29, 2023 · Let’s look at some examples to illustrate the use of the CAST function: Basic Usage. In this example, the string ‘123’ is cast to an integer, resulting in the value 123. Date Conversion. Here, a string representing a date is cast to the DATE data type. Decimal to Integer.

  11. Some results have been removed
Refresh