0

<Root> <Row> <Col2>data</Col2> <Col3>data1</Col3> <Col4>data3</Col4> <Col1>Rowid1</Col1> </Row> <Row> <Col2>data</Col2> <Col3>data2</Col3> <Col4>data4</Col4> <Col1>Rowid2</Col1> </Row> </Root>

The above xml is stored in sql server with datatype xml.
Here data3 is entered by user eg: data3 = A & vbnewline & B.

Query 1:

select column from table where [Sl_No]=7203

Result : A & vbnewline & B

Query 2:

select column.value('(/Root/Row[Rowid=''1'']/col4/text())[1]','varchar(max)') from table where [Sl_No]=7203

Result : A & vblf & B

All users use windows os.
why is xquery converting vbnewline(vbcrlf) to vblf?

IT researcher
  • 3,274
  • 17
  • 79
  • 143
  • I suspect that the CR was lost when it was stored in SQL Server: [Linq2SQL storing XElement to SQL Server database removes whitespaces](https://stackoverflow.com/a/52499464/1115360). – Andrew Morton Oct 25 '19 at 08:41
  • @AndrewMorton Query 2 giving result A & vblf & B for only some rowid for others it gives A & vbnewline & B. i.e. Cr is lost only for some rowids only. – IT researcher Nov 04 '19 at 05:42

0 Answers0