Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

BCP XML FileFormat error Invalid ordinal for field 2 Expand / Collapse
Author
Message
Posted Friday, October 1, 2010 11:22 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, March 28, 2015 4:20 PM
Points: 14, Visits: 83
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
Post #996867
Posted Monday, October 19, 2015 9:07 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: 2 days ago @ 2:15 AM
Points: 2, Visits: 42
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

Post #1728986
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse