SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


BCP XML FileFormat error Invalid ordinal for field 2


BCP XML FileFormat error Invalid ordinal for field 2

Author
Message
Ankit Peshwaria
Ankit Peshwaria
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 84
Hi,

When creating xml fileformat its throwing me error "invalid ordinal".

when created non-xml file format, no error, and was also able to load data file into sql table. Not sure why bcp (Version: 10.50.1600.1) is not able to create xml file format.

C:\>BCP "MyGDB.dbo.Items_Import" format nul -f"C:\Ankit\Temp\BCP\ItemsMaster.xml" -x -w -T -S"(Local)"

SQLState = HY000, NativeError = 0
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid ordinal for field 2 in xml format file.

Column_name Type Computed Length Prec Scale Nullable TrimTrailingBlanks FixedLenNullInSource Collation
Item Number varchar no 18 no yes no SQL_Latin1_General_CP1_CI_AS
Description1 nvarchar no 80 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS
Description2 nvarchar no 80 yes (n/a) (n/a) SQL_Latin1_General_CP1_CI_AS
UM varchar no 3 yes yes yes SQL_Latin1_General_CP1_CI_AS

~ Ankit


Kindest Regards,

Ankit Peshwaria
alex69ander69
alex69ander69
Grasshopper
Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)

Group: General Forum Members
Points: 20 Visits: 43
Hi there,

Take a look at https://connect.microsoft.com/SQLServer/feedback/details/715049/bcp-fails-to-create-an-xml-format-file-if-column-name-contains-a-space
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search