Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Saving Fmt Files via bcp

Author  Topic 

Rach2009
Starting Member

37 Posts

Posted - 2009-11-13 : 06:54:05
Hi

I am currently trying to save a format file via a bcp interactive session but when I get to the end and say 'Y' to saving the file and specifiy the filepath and name ("C:\Temp\Shipped.fmt"), it fails to save and I get an error message saying:-

SQLState = HY000, NativeError=0, Error=[Microsoft][SQL Native Client]Unable to open host data-file

Any ideas why this is happening? Am I entering the filepath/name correctly?

Thanks!

Rachel

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-13 : 10:44:44
Show us your exact command.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

Rach2009
Starting Member

37 Posts

Posted - 2009-11-13 : 11:16:04
Do you want to save this format information in the file [Y/N] Y
Host filename [bcp.fmt]: "\\uksql04\Insert$\Shipped.fmt"

...and then the error message appears as above. The Insert folder is a shared SQL folder.

Do you need the details of the format file? This is quite lengthy but for the most part I just follow the prompts. The initial bcp command is the following:-

bcp Dispatcher_Archive.dbo.ORDER_HEADER In "\\uksql04\Insert$\Shipped.csv" -S UKSQL04 -T -t","


Many Thanks

Rachel
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-13 : 11:22:54
The error indicates that your account is unable to access that share. The error shows that the issue is with Shipped.csv and not the format file.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -