Showing posts with label actual. Show all posts
Showing posts with label actual. Show all posts

Tuesday, February 14, 2012

data format of XML data in datafile generated by bcp -n

Hi,

The XML column data stored in the data file generated by using bcp -n is in two different formats. one is storing the actual length of the data prefixed by an 8 byte length infront of the data; the other one whithout the prefixed length but "FEFFFFFFFFFFFFFFFC030000" infront of the data.

Could any body please tell me what the binary means?

Thanks,

Lijie

In native mode, the length prefix for xml data is of 8 bytes. There are 3 variations of this length:

a) If it's 0xFFFFFFFFFFFFFFFF then the column value is NULL

b) If it's 0xFFFFFFFFFFFFFFFE (FEFFFFFFFFFFFFFFF in little endian), that means the data is stored as chunks, so following this length indicator there will be chunks of xml column data with 4 bytes length prefix and then chunk data and so on, until a chunk is hit whose length is specified by 0x00000000 indicating end of column data.

c) Length prefixed data, for any value other than (a) and (b) this indicates the actual length of data.

Thanks

Waseem Basheer

SDE - Data Programmability Group

Microsoft Corp.

data format of XML data in datafile generated by bcp -n

Hi,

The XML column data stored in the data file generated by using bcp -n is in two different formats. one is storing the actual length of the data prefixed by an 8 byte length infront of the data; the other one whithout the prefixed length but "FEFFFFFFFFFFFFFFFC030000" infront of the data.

Could any body please tell me what the binary means?

Thanks,

Lijie

In native mode, the length prefix for xml data is of 8 bytes. There are 3 variations of this length:

a) If it's 0xFFFFFFFFFFFFFFFF then the column value is NULL

b) If it's 0xFFFFFFFFFFFFFFFE (FEFFFFFFFFFFFFFFF in little endian), that means the data is stored as chunks, so following this length indicator there will be chunks of xml column data with 4 bytes length prefix and then chunk data and so on, until a chunk is hit whose length is specified by 0x00000000 indicating end of column data.

c) Length prefixed data, for any value other than (a) and (b) this indicates the actual length of data.

Thanks

Waseem Basheer

SDE - Data Programmability Group

Microsoft Corp.

Data flow task reports different row count than actual rowcount

I have a data flow task that moves all the rows from 18 tables on a production server to a reporting services server. One table, which does not contain the most rows (about 650K rows) reports all the rows have been transferred. However, if I go in to the SQL Mgmt Studio and do a Select count(*) on the table, there are only 110k rows.

Has anyone else experienced this problem?

Thanks,

Nick Anzano

How does the data flow report that 650k rows have been transferred? Are you looking in the logs?

SSIS could certainly report that it has sent 650k to the database - what happens then is up to the database! Is the target database SQL Server? If so, use SQL Profiler to see what is happening when the rows are being sent to the server. Perhaps they are not being committed for some reason.

Donald Farmer