sql server 2000 to foxpro numeric conversion

  • I am sing DTs to move data from sql server to Foxpro.

    using visual foxpro oledb driver

    I am explicitly creating a table like:

    CREATE TABLE `e:\medispan 2\msiref\spec_dse` (

    `m_drug` N (5,0) NOT NULL,

    `m_form` C (3) NOT NULL,

    `dose_units` C (11) null,

    `ndse_units` C (11) NULL,

    `ndosage` N (12,3) NULL,

    `str_mult` N (8,3) NOT NULL,

    `brand_name` C (35) NULL,

    `strength` N (12,3) NOT NULL,

    `m_str_unit` C (11) NOT NULL,

    `dose_mult` N (8,3) NULL, `bypckg` L NOT NULL

    )

    And when I look at Foxpro table structure all the numeric col are 2 more

    than what I specified..

    mdrug is n(6,0)

    str_mult is n(10,3)

    strength is n(14,3)

    ndosage is n(14,3)

    dose_mult is n(10,3)

    WHy is this conversion adding 2 more to the precision of numeric fields

    Thanks for any help!!

  • This was removed by the editor as SPAM

  • deleted duplicate

    Edited by - zhesley on 10/27/2003 08:40:30 AM

  • I am not 100% sure but perhaps

    when DTS exports numbers it adds two extra

    for a potential negative sign of the number i.e. '-'

    and another for a potential decimal point i.e. '.'

    When I export intergers from SQL Server in Fixed Length ASCII the field always comes out as 12 in length.

    Edited by - zhesley on 10/27/2003 08:42:49 AM

  • deleted duplicate

    Edited by - zhesley on 10/27/2003 08:42:10 AM

  • In Foxpro the field width includes the decimals, the minus sign and the decimal place('.'). So a number field like -9999.99 needs to be set up as N(8, 2). DTS might be trying to adjust the width based on actual values in your data to make sure that data isn't truncated.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply