gpt4 book ai didi

sql-server - 错误 = [Microsoft][SQL Server 的 ODBC 驱动程序 11]警告 : BCP import with a format file will convert empty strings in delimited columns to NULL

转载 作者:行者123 更新时间:2023-12-02 19:05:29 34 4
gpt4 key购买 nike

我将 Windows Server 从 2008 年升级到 2012 年,将 SQL Server 从 2008 年升级到 2014 年。我有一个使用 BCP 命令从数据库导出数据的进程。命令如下:

bcp "exec db_name.dbo.table_name 20160204, 0" queryout D:\myfolder\201602\20160204\output.txt -c -T -S  SERVER_NAME

升级前

2016-02-02 04:05:16,038 [2492] INFO  - 
Starting copy...
1000 rows successfully bulk-copied to host-file. Total received: 1000

升级后

2016-02-05 04:04:37,006 [15872] INFO  - 
Starting copy...
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC Driver 11 for SQL Server]Warning: BCP import with a format file will convert empty strings in delimited columns to NULL.
1000 rows successfully bulk-copied to host-file. Total received: 1000

尽管已创建输出文件,但日志中不希望出现错误/警告。有没有办法抑制这个警告?

最佳答案

显然,根据 Microsoft 的说法,这不是一个错误,而只是一个警告,可以安全地忽略。( Detailed discussion and work around here )

就我而言,我正在解析 BCP 控制台输出中的字符串“Error”并报告该过程失败。由于我使用 .NET 框架的 Process 类在 C# 代码中调用 BCP 命令,因此我必须添加代码来检查进程退出代码 0 并抑制此特定警告。

关于sql-server - 错误 = [Microsoft][SQL Server 的 ODBC 驱动程序 11]警告 : BCP import with a format file will convert empty strings in delimited columns to NULL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35229957/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com