Explain implicit and explicit data type conversion
Answers
IMPLICIT DATA TYPE CONVERSION :
Data types can be converted either implicitly or explicitly. Implicit conversions are not visible to the user. SQL Server automatically converts the data from one data type to another. For example, when a smallint is compared to an int, the smallint is implicitly converted to int before the comparison proceeds.
EXPLICIT DATA TYPE CONVERSION :
xplicit data type conversion is specified in terms of SQL data type definitions. The ODBC syntax for the explicit data type conversion function does not restrict conversions. The validity of specific conversions of one data type to another data type will be determined by each driver-specific implementation. The driver will, as it translates the ODBC syntax into the native syntax, reject those conversions that, although legal in the ODBC syntax, are not supported by the data source. The ODBC function SQLGetInfo, with the conversion options (such as SQL_CONVERT_BIGINT, SQL_CONVERT_BINARY, SQL_CONVERT_INTERVAL_YEAR_MONTH, and so on), provides a way to inquire about conversions supported by the data source.
Implicit data type conversion :-
In mixed expression, the data type of the result gets converted automatically into its higher type without intervention of the user. This system of type conversion is known as Implicit type conversion or coercion.
Explicit data type conversion :-
When the data type gets converted into another type after user intervention, the type conversion is known as explicit type conversion or forced conversion also as type casting.