问题描述
今天,我创建了一个新的登台表和一个BCP .fmt文件.我创建了一些测试数据,并尝试从命令行运行BCP实用程序:
Today I created a new staging table and a BCP .fmt file. I created some test data and attempted to run the BCP utility from the command line:
我以前的工作中大约有20种不同格式的文件和登台表,这是我第一次遇到此错误.
I've got about 20 different format files and staging tables from previous work and this is the first time I have encountered this error.
如何解决此错误?
请注意,我在下面添加了我的解决方案,但是如果您还有其他答案,请添加它们.答案非常古怪/晦涩,以至于我认为可能会对其他人有所帮助.
Please note, I have added my solution below, but if you have other answers, please add them in. The answer was so quirky/obscure that I think it may help others.
推荐答案
基本上,这真的很奇怪.为了使其正常工作,请确保在格式文件中定义的最后一列之后有一个空行.我添加了一个额外的空行,重新保存了文件,然后BCP实用程序成功运行了该文件.我用红色矩形指示了多余的行.
Basically, this one was really strange. In order for it to work, make sure there is an empty line after the last column defined in the format file. I added an extra empty line, resaved the file, and then the BCP utility ran the file successfully. I've indicated the extra line with a red rectangle.
这篇关于读取BCP格式文件时发生I/O错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!