Microsoft Knowledge Base Email Alertz

(883503) - Explains that you may receive an error message when you try to import dates by using the bcp utility, and the day or the month contains one digit and the other contains two digits. Provides a list of files that are updated in the hotfix.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 883503 - Last Review: November 15, 2007 - Revision: 2.3

FIX: You receive an "Invalid character value" error message when you use the bcp utility to import dates

Hotfix download is availableHotfix Download Available
View and request hotfix downloads

On This Page

SYMPTOMS

When you try to import dates by using the bcp utility, you may receive the following error message:
[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification
This behavior occurs with dates that are formatted to contain a dash (-) character and that have two digits in the month or in the day, but not in both. For example, dates such as 12-1-2004 and 1-12-2004 cause the error. However, a date such as 12-12-2004 does not cause the error.

RESOLUTION

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support (http://support.microsoft.com/contactus/?ws=support)
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Service packs that will include this fix

Microsoft Windows Server 2003 Service Pack 1 (SP1).

Prerequisites

Microsoft Data Access Components (MDAC) 2.8.

Restart requirement

You must restart your computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

   Date         Time   Version           Size     File name     
   ----------------------------------------------------------------
   09-Aug-2004  11:22  2000.85.1050.0    73,728   Dbnetlib.dll     
   09-Aug-2004  11:22  2000.85.1050.0    28,672   Dbnmpntw.dll     
   09-Aug-2004  11:21  2.80.1050.0       315,392  Msadce.dll       
   09-Aug-2004  11:22  2.80.1050.0       135,168  Msadco.dll       
   09-Aug-2004  11:22  2.80.1050.0       49,152   Msadcs.dll       
   09-Aug-2004  11:21  2.80.1050.0       147,456  Msadds.dll       
   09-Aug-2004  11:21  2.80.1050.0       507,904  Msado15.dll      
   09-Aug-2004  11:22  2.80.1050.0       163,840  Msadomd.dll      
   09-Aug-2004  11:22  2.80.1050.0       184,320  Msadox.dll       
   09-Aug-2004  11:22  2.80.1050.0       53,248   Msadrh15.dll     
   09-Aug-2004  11:22  2.80.1050.0       225,280  Msdaora.dll      
   09-Aug-2004  11:22  2.80.1050.0       192,512  Msdaprst.dll     
   09-Aug-2004  11:22  2.80.1050.0       147,456  Msdart.dll       
   09-Aug-2004  11:22  2.575.1050.0      139,264  Msorcl32.dll     
   09-Aug-2004  11:22  3.525.1050.0      221,184  Odbc32.dll       
   09-Aug-2004  11:22  2000.85.1050.0    24,576   Odbcbcp.dll      
   09-Aug-2004  11:22  2.80.1050.0       442,368  Oledb32.dll      
   09-Aug-2004  11:22  2000.85.1050.0    503,808  Sqloledb.dll     
   09-Aug-2004  11:22  2000.85.1050.0    401,408  Sqlsrv32.dll     
   09-Aug-2004  09:56  2000.85.1050.0    208,896  Sqlxmlx.dll                                           

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the problem

  1. In Notepad, or a text editor of your choice, paste the following code:
    1-12-2004
    12-1-2004
  2. Save the text file as Datadate.txt.
  3. Start Microsoft SQL Query Analyzer.
  4. Run the following code in SQL Query Analyzer:
    create database abc
    go
    use abc
    go
    create table mydate (c1 datetime not null)
    go
    
  5. At the command prompt, type bcp abc..mydate in "FilePath\Datadate.txt" -c -T, and then press ENTER. You receive the error message that is mentioned in the "Symptoms" section.

    Note FilePath is a placeholder for the path of the Datadate.txt file on your computer.

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
839801  (http://kbalertz.com/Feedback.aspx?kbNumber=839801/ ) FIX: Hotfixes are available for MDAC 2.8
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
824684  (http://kbalertz.com/Feedback.aspx?kbNumber=824684/ ) Description of the standard terminology that is used to describe Microsoft software updates
For more information about the bcp utility, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/aa174646(SQL.80).aspx (http://msdn2.microsoft.com/en-us/library/aa174646(SQL.80).aspx)

APPLIES TO
  • Microsoft Data Access Components 2.8
Keywords: 
kbautohotfix kbqfe kbhotfixserver kbimport kbdatabase kbfix KB883503
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Pavel - pavelnegritu NOSPAM-AT-NOSPAM yahoo.com Report As Irrelevant  
Written: 7/20/2005 9:07 AM
i use sql server 2000 sp4 this error applies when using date time format 'yyyy/mm/dd' as input parameter when debugging store procs with sql analyzer. workaround: use date time format of yyyy-mm-dd