Converts a sqlconvert () string to an integer, and converts a datetime string to a datetime string: convert (data_type (length), data_to_be_converted, style) instance selectconvert (varchar (30), getdate (), 101) now to integer convert (int, column) if I want to convert the mobile phone number to integer, select SQL convert () string to integer date converter type
Convert to date writing
Convert (data_type (length), data_to_be_converted, style)
Instance
Select convert (varchar (30), getdate (), 101) now
Convert to integer
Convert (int, column)
If I want to convert a mobile phone number into an integer,
Select convert (int (8), mo) moint
An error is reported. Why? Let's take a look at the instance.
Select convert (bigint, mo) moint
This is correct because the number type is incorrect. The mobile phone number is 11 bits, while the int type can only be 8 bits. Naturally
An error occurs.