English 中文(简体)
SQL SERVER 2005 BCP Format File Creation Error
原标题:

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!

最佳回答

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.





相关问题
Export tables from SQL Server to be imported to Oracle 10g

I m trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I m not using any constraints/...

SQL server: Can NT accounts be mapped to SQL server accounts

In our database we have an SQL server account that has the correct roles to access some of the databases. We are now switching to windows authentication and I was wondering if we can create a NT user ...

SQL Server 2000, ADO 2.8, VB6

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

热门标签