本文介绍了BCP IN 错误 = [Microsoft][SQL Server Native Client 10.0]无效的日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试通过执行批处理文件通过 BCP-IN 在表中插入一些值.但面临这个问题-
I am trying to insert some values in a table through BCP-IN by executing batch file.But facing this issue-
Starting copy...
SQLState = 22008, NativeError = 0
Error = [Microsoft][SQL Server Native Client 10.0]Invalid date format
SQLState = 22008, NativeError = 0
Error = [Microsoft][SQL Server Native Client 10.0]Invalid date format
SQLState = 22008, NativeError = 0
Error = [Microsoft][SQL Server Native Client 10.0]Invalid date format
SQLState = 22005, NativeError = 0
插入数据的文件是这样的-
The file thorugh which data getting inserted is like this-
Marcus, Tom 371332 11-1-09 0:00 720.04 25.2 108.01 0 43.2
以及插入数据的表有列-
And the table in which data getting inserted having coloumn-
EFFECT_DATE2] [datetime2](3) NULL,
有什么建议可以避免这个错误吗?
Any suggestion how to avoid this error?
推荐答案
尝试在格式文件中使用 SQLCHAR 而不是 SQLDATETIME.将日期时间字段中的数据设置为本地格式,并使用 -R 键运行 bcp.exe.
Try using SQLCHAR in format file instead of SQLDATETIME. Set data in datetime field into your local format and use -R key for bcp.exe run.
这篇关于BCP IN 错误 = [Microsoft][SQL Server Native Client 10.0]无效的日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!