Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Location
    Atlanta
    Posts
    2

    Red face Unanswered: SQL Server conversion errors

    I am receiving multiple data format issues where running procedures via an application in SQL Server.

    Insert error: [Microsoft][ODBC SQL Server Driver][SQL Server]Syntax error converting datetime from character string

    Insert error: [Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

    Insert error: [Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type decimal to decimal.

    My Environment is:
    MS Server 2000 service pack 2
    MS SQL Server version 8.00.534
    ODBC version 2000.80.528.00

    My application is setting the ODBC date format to
    MON DD YYYY HH:MIS

    When running inserts I am receiving information in profiler that looks like this:
    exec sp_execute 31, '21800008', '0''0''03', 0.000000000000000e+000, 'A', 'Sergeant ', 'Sergeant ',
    'POS', 'NFY', 'Jul 1 2003', '90202036 ', '2180 ', 'A', 'JAN 01 1910 00:00:00', 'Y', 'N', 'N',
    0.000000000000000e+000, 'Y', '21900001', ' ', ' ', ' ',
    'SOADM', ' ', ' ', 'DC ', 'NEY', 'H', 40.0, ' ', ' ', ' ', 'R', 'F',
    8.0, 8.0, 8.0, 8.0, 8.0, 0.0, 0.0, 0.000000000000000e+000, ' ', ' ', 'SOADM',
    '822P15', ' ', ' ', 0, 0, '7720', 'Sergeant', 'N', 0.000000000000000e+000, 'Y', ' ', 'N'

    The third field 0''03 is supposed to be Jul 01 2003 and the fields that reflect 0.000000000000000e+000 are supposed to be 0. I'm not sure why this data corruption is occurring because I am on service pack 2 everywhere and am setting a date format. What gives? Has anyone experienced this type of issue before.

  2. #2
    Join Date
    Oct 2002
    Posts
    369

    Re: SQL Server conversion errors

    You may wish to consider posting the tsql code of the stored procedures involved. (The table schemas and sample data to use to reproduce the issue would also assist others in providing more useful feedback.)

Posting Permissions

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