user3344443
user3344443

Reputation: 485

bcp export format file invalid name specified or access denied

In cmd, I'm trying to create a fmt file, my code is

bcp Database1.dbo.Table1 format nul -c -x -f c:\format.xml -T -S .\sql2005

Then I get error saying Format file could not be opened. Invalid name specified or access denied.

I wonder how I can check if the access is denied or not? And how I can give access the permission?

Upvotes: 2

Views: 2875

Answers (1)

user3155430
user3155430

Reputation: 13

You are writing your file to the root of the C: drive if you have UAC enabled then you would need to run your CMD prompt as an administrator to get access to write to that location. If you create a sub-folder like c:\BCPTest\ then you should be able to write to that folder.

Upvotes: 1

Related Questions