MS SQL DataTypes QuickRef

Embed Size (px)

Citation preview

  • 7/31/2019 MS SQL DataTypes QuickRef

    1/2

  • 7/31/2019 MS SQL DataTypes QuickRef

    2/2

    108 hh:mm:ss

    109* mon dd yyyy hh:mi:ss:mmmAM

    110 mm-dd-yyyy

    111 yyyy/mm/dd

    112 yyyymmdd

    113* dd mon yyyy hh:mm:ss:mmm(24h)

    114 hh:mi:ss:mmm(24h)

    *2-digit year unavailable

    minute mi n 0 59

    second ss s 0 59

    millisecond ms - 0 999

    datetime_new= dateadd(datepart,number,datetime)

    number_diff= datediff(datepart,from_datetime,to_datetime)

    string_name= datename(datepart,datetime)

    number_value= datepart(datepart,datetime)

    adSchemaColumns=4The ADO OpenSchema method returns incomplete info in the DATA_TYPE column for many data types.

    Variable length columns are represented by fixed-length types, with the adFldFixed=16 flag in COLUMN_FLAGS clear.

    Long fields have the adFldLong=128 flag set in COLUMN_FLAGS.

    The smallmoneyNUMERIC_PRECISION is less than 19, distinguishing it from money.

    The smalldatetime datatype cannot be distinguished from datetime (but the former is of limited usefulness given the range, so

    is perhaps best avoided).

    Defaults are indicated by COLUMN_HASDEFAULT and available in COLUMN_DEFAULT.Character (and binary) field lengths are given in CHARACTER_MAXIMUM_LENGTH.

    CHARACTER_OCTET_LENGTH contains the field's length in bytes.

    Numeric column precision and scale are given byNUMERIC_PRECISION and NUMERIC_SCALE, respectively.

    Finally, IS_NULLABLE denotes whether the field may contain null values.

    ADO OpenSchemaadSchemaProcedureParameters=26The ADO OpenSchema method returns incomplete info in the DATA_TYPE column for many data types.

    The COLUMN_FLAGS field is not available.

    The TYPE_NAME column returned for stored procedure parameters can be used for accurate type information.

    The smallmoneyNUMERIC_PRECISION is less than 19, distinguishing it from money.

    The smalldatetime datatype cannot be distinguished from datetime (but the former is of limited usefulness given the range, so

    is perhaps best avoided).

    Defaults are indicated by PARAMETER_HASDEFAULT and available in PARAMETER_DEFAULT.

    PARAMETER_TYPE is the direction of the parameter: adParamInput=1, adParamInputOutput=3, adParamOutput=2,

    adParamReturnValue=4, oradParamUnknown=0.

    Character (and binary) field lengths are given in CHARACTER_MAXIMUM_LENGTH.

    CHARACTER_OCTET_LENGTH contains the field's length in bytes.

    Numeric column precision and scale are given byNUMERIC_PRECISION and NUMERIC_SCALE, respectively.

    Finally, IS_NULLABLE denotes whether the field may contain null values.

    This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.