문제

I am having an issue with SQL Server 2005's BCP utility. I am running SQL Server Express 2005 on Windows Vista. I am trying to create a non-XML format file for some tables in my database.

I run the following code:

bcp 'jProd_000-1'.users format nul -T -f users.fmt 

I get the following error:

An Error occurred while processing the command line

It doesn't display any other helpful information with regards to the error. I also used a SQL Server login instead of the '-T'. Can anyone provide any insight? What am I doing wrong?

Thank you!

도움이 되었습니까?

해결책 3

I just figured it out... yeah rookie mistake. It had to do with the database name I used. Aparently there's no way to use BCP on database names that contain "-"'s, even if you put the database name in double or single quotes. Thank you for the response!

다른 팁

I was getting the same problem with BCP against SQL 2008. Using square brackets around the database name seemed to resolve it. Worth a try. e.g:

bcp "[database-name].dbo.table" format nul -T -f users.fmt

Your quoting looks a little odd. Is jProd_000-1 a schema?

Assuming it is, try

bcp "jProd_000-1.users" format nul -T -f users.fmt 

However, this may not do what you expect - it will ask you to define the datatypes for each column manually.

There's no way I'm aware of to automatically generate a non-XML format file.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top