Works much like CAST, changing a value's data type in T-SQL, with the addition of an optional style number; 126, for instance, gives ISO 8601 dates.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains CONVERT in context, with comparison tables and the common traps.
Terms in this definition
- LIKE
Compares strings with a pattern that can contain the % and _ wildcards. Because it only understands character patterns, searching big volumes of text this way is much slower than using full-text search.
- CAST
Converts a value to a different data type using the syntax
CAST(expr AS type); this ANSI-standard T-SQL function errors out if the conversion can't be done. - Data type
A rule limiting what a column may contain, for example INT for integers, DECIMAL for numbers with fractions or VARCHAR for text of varying length. Which types exist depends on the database product.
- T-SQL
The dialect of SQL that Microsoft uses for Azure SQL and SQL Server. Azure Monitor logs are queried with KQL instead.
- ISO
The International Organization for Standardization. SQL became an ISO standard in 1987, twelve months after ANSI adopted it.
Related terms
- Dynamic format string
A DAX expression on a measure that works out which format string to apply depending on context, for example a different currency for each country. The measure stays numeric, whereas the FORMAT function would convert the result to text.
- Fill down
In Power Query, copies the last non-null value above into each null cell below it (Fill up goes the other way). Empty strings aren't nulls, so convert them first or they stay as they are.
- Manage fields
An Eventstream step for reshaping events: you can add, drop or rename fields and convert their types, and built-in functions handle strings, dates, times and maths.