question

WilliamChuongTran-4988 avatar image
0 Votes"
WilliamChuongTran-4988 asked ·

Unable To Open BCP format file

Hi, I would create a format file by using cmd and I got the error as picture


74311-untitled.jpg



please help to fix thanks.

sql-server-generalsql-server-transact-sql
untitled.jpg (33.4 KiB)
· 3
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I can not see the error, because there is a "Copy Image" button over.

Please post the complete command and error message as text instead of a screenshot.

0 Votes 0 ·

Here the image, ![74341-image.png][1]


0 Votes 0 ·
image.png (126.5 KiB)
Viorel-1 avatar image Viorel-1 WilliamChuongTran-4988 ·

Maybe the .fmt file is not accessible. Check if this command works:

 type "\\195.184.11.244\WMS-2017\EDIData\MyFirstImport.fmt"

0 Votes 0 ·
ErlandSommarskog avatar image
0 Votes"
ErlandSommarskog answered ·

Either the file path is wrong, or you don't have write permission to that folder.

Error messages from BCP are not always that crystal clear.

· 2 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ErlandSommarskog, I am sure that I have write permission because I am using as admin.

Any chance ?

0 Votes 0 ·
ErlandSommarskog avatar image ErlandSommarskog WilliamChuongTran-4988 ·

Admin of what?

Keep in mind that you are logged in on machine A, and you are trying to write to a share on machine B. You may not have permission on that share. Hey, you may not even be able to authenticate.

And if the path is wrong, no permission in the world will save you.

You can try

ECHO "test" > "\\195.184.11.244\WMS-2017\EDIData\MyFirstImport.fmt"

To test whether the path is legit.



0 Votes 0 ·
Cathyji-msft avatar image
0 Votes"
Cathyji-msft answered ·

Hi @WilliamChuongTran-4988,

The version of the bcp utility (Bcp.exe) used to read a format file must be the same as, or later than the version used to create the format file. For example, SQL Server 2012 (11.x) bcp can read a version 10.0 format file, which is generated by SQL Server 2008 bcp, but SQL Server 2008 bcp cannot read a version 11.0 format file, which is generated by SQL Server 2012 (11.x) bcp. Refer to Create a Format File (SQL Server).

Did you follow the steps from this document to create format file? Please check the location of the shared folder is correct and you have read and write permission on this folder.


If the response is helpful, please click "Accept Answer" and upvote it, thank you.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.