Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2003
    Location
    @ home
    Posts
    163

    Unhappy Unanswered: DTS - Excel conversion from Number to Database Char

    I have to import data from Excel file to an SQL Server Database.
    One of the Excel Worksheet columns it's number (with max value of 4550204008914630000), I will import the column to a char 21 database field. Using a DTS to do the work, when I import that column it will convert the data in something like 4.5502041E+18.
    Can you give me some help for the DTS.

    Thanks,
    Paulo

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Does the table already exists? Or are you letting DTS create it?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Feb 2003
    Location
    @ home
    Posts
    163
    The Table already exists. It's created each time the DTS run.

    This is the script used on the DTS:
    /*
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Temp_freqnib]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[Temp_freqnib]
    GO

    CREATE TABLE [dbo].[Temp_freqnib] (
    [Cartao] [char] (10) COLLATE Latin1_General_CI_AS NOT NULL ,
    [numX] [char] (21) COLLATE Latin1_General_CI_AS NOT NULL ,
    [desc] [varchar] (80) COLLATE Latin1_General_CI_AS NULL
    ) ON [PRIMARY]
    GO
    */

    It must be imported to the numX field.

    Thanks,
    Paulo

  4. #4
    Join Date
    Feb 2003
    Location
    @ home
    Posts
    163
    my mistake...

    The table exists only when the DTS runs, and it's created before the import of the data from excel.

    Paulo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •