- SELECT CONVERT(NVARCHAR(32),HashBytes('MD5', '[email protected]'),2). That will give you
Справочник по функциям CAST и CONVERT Transact-SQL. Эти функции преобразуют выражения из одного типа данных в другой.
The datatype to convert expression to. Can be one of the following: bigint, int, smallint, tinyint, bit, decimal, numeric, money, smallmoney, float, real, datetime, smalldatetime, char
В тех случаях, когда необходимо выполнить преобразования от типов с высшим приоритетом к типам с низшим приоритетом, то надо выполнять явное приведение типов. Для этого в T-SQL определены две функции: CONVERT и CAST .
This SQL Server tutorial explains how to use the CONVERT function in SQL Server (Transact-SQL)
При преобразовании из float и numeric в integer, функция CONVERT усекает результат. Для других преобразований функция CONVERT будет округлять результат. См. Также функцию CAST. Применение. Функция CONVERT может использоваться в следующих версиях SQL...
In this article, we discuss SQL Server data type converting operations and built-in functions SQL CONVERT and TRY_CONVERT with various examples.
We have three different ways in which we can achieve the desired tasks. We would be examining each one of them and check their output. In the first method we have used CAST function; in the second method we have used CONVERT function and in the third method we have used STR function.
First up are two T-SQL functions that allow you to convert a hex value to an integer. In addition to these functions, there’s also the concept of implicit conversion, which can also produce the same result.
In this article we cover different ways to format numbers in SQL Server using various functions like CAST, CONVERT, ROUND, CEILING, FLOOR and FORMAT.