Results 1 to 5 of 5

Thread: Error converting data type DBTYPE_DBTIMESTAMP to datetime.

  1. #1
    Join Date
    Jul 2008
    Posts
    2

    Error converting data type DBTYPE_DBTIMESTAMP to datetime.

    Hi,
    I would like to migrate an oledb database to sql 2005 database
    While converting i got "Error converting data type DBTYPE_DBTIMESTAMP to datetime."
    I have severl colones that i need to convert them to datetime at the same time in the same querry.

    To begin i hve tried this but it's not working :
    Code:
    select date_clotu FROM OPENROWSET(
       'MSDASQL',
       'Driver={Microsoft dBase Driver (*.dbf)};DBQ=C:\Documents and Settings\oledb',
       'Select TO_CHAR(date_clotu) FormattedDate  from SQDI')where isdate(FormattedDate)=0 ;
    Can u help me plz ...
    Last edited by skystar; 07-04-2008 at 04:16 AM.

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    What's the value in DBTIMESTAMP type column look like? Tried load them in char type column first then convert?

  3. #3
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    dbase date must be out of range for sql server or date is not valid.

  4. #4
    Join Date
    Jul 2008
    Posts
    2
    The value have this format "07/01/2005 00:00:00".

    i still need ur help , 10x

  5. #5
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    First go to the oledb database and update all the invalid dates. then run the import.

    check BOL for SQL Server 2000/2005 datetime range values

    I have seen invlaid dates in other RDBMS like 01/01/0001. Possible only in SQL Server 2008.

Posting Permissions

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