Questions tagged [xml-column]

24 questions
12
votes
3 answers

XML data type in EF 4.1 Code First

I would like to use SQL Server xml type as a column type for an entity class. According to this thread it's possible to map such a column to string type: public class XmlEntity { public int Id { get; set; } [Column(TypeName="xml")] public…
11
votes
4 answers

Sql Server XML columns substitute for Document DB?

Is it possible to use Sql Server XML columns as a substitute for a real Document DB (such as Couch or Mongo) ? If I were to create a table with a guid PK Id and an XML column for the document. What would be the main problems compared to using a…
Roger Johansson
  • 22,764
  • 18
  • 97
  • 193
9
votes
1 answer

Check if SQL Server 2005 XML field is empty

I just did this: Delete FROM MyTable WHERE ScopeValue = "" Delete FROM G_Scope WHERE ScopeValue is '' Delete FROM G_Scope WHERE ScopeValue = empty Delete FROM G_Scope WHERE ScopeValue is empty I want to delete all rows with xml field (not…
msfanboy
  • 5,273
  • 13
  • 69
  • 120
8
votes
2 answers

How is an xml column stored in SQL Server 2008?

I try to understand how SQL Server 2008 store xml columns in an attempt to estimate table size in our product. I'm using DATALENGTH(xml_column) to run some test and results are disturbing : Xml document length | Datalength | Bytes per character 175 …
Nicolas Repiquet
  • 9,097
  • 2
  • 31
  • 53
4
votes
3 answers

How do I update an XML column in sql server by checking for the value of two nodes including one which needs to do a contains (like) comparison

I have an xml column called OrderXML in an Orders table... there is an XML XPath like this in the table... /Order/InternalInformation/InternalOrderBreakout/InternalOrderHeader/InternalOrderDetails/InternalOrderDetail There InternalOrderDetails…
Seth Spearman
  • 6,710
  • 16
  • 60
  • 105
3
votes
2 answers

Sql Server Xml Column Best Practices

What are the best practices for working with Sql server Xml columns to ensure quick performance and also ease of reporting? How do you set up the column? do you leave it as untyped? or associate it with a schema? Does associating the xml column…
Peter
  • 1,776
  • 13
  • 20
3
votes
1 answer

Select child nodes until attribute value in xpath (SQL Server)

I have an XML column in SQL Server database (SQL Server 2012) with the following structure:
nativehr
  • 222
  • 2
  • 8
2
votes
2 answers

Sql Server Xml Column query performance?

I'm trying to query an xml column in sql server. I've created a primary index on the column and query it using: SELECT * FROM MyTable where Doc.exist('/xml/root/propertyx/text()[. = "something"]') = 1 In a table with 60 000 entries , this query…
Roger Johansson
  • 22,764
  • 18
  • 97
  • 193
2
votes
1 answer

Delete a row in a XML column of a SQL Server table based on attribute value

I have a XML column in a SQL Server table. The data looks like this:
Sparrow
  • 355
  • 4
  • 19
2
votes
1 answer

Preferred way to access data within XML columns in SQL Server

Background Recently I've started to use XML a lot more as a column in SQL Server 2005. During a bit of downtime yesterday, I noticed that two of the link tables I used a really just in the way and it bores me to tears having to write yet more…
Tom
  • 3,354
  • 1
  • 22
  • 25
2
votes
1 answer

Rename XML Node Name in XML column SQL Server using SQL Script

I have a Xml Column in a SQL Server 2012 database table called ValidationList. I have a few hundred records in this table. I have a record like follows
MicroMan
  • 1,988
  • 4
  • 32
  • 58
1
vote
1 answer

Get values from xml table column

I have a table with XML column as shown below.
Richi Sharma
  • 175
  • 1
  • 13
1
vote
1 answer

Have Excel Row Saved in SQL Server Column (XML data type). How Do I update a particular Cell value?

I have a row of excel data (i.e. several cells from an excel sheet) saved into a SQL Server table, in a column that is of datatype XML. I need to update the value, in a particular cell, in this data saved in the XML column, with a new value that is…
Shiva
  • 20,575
  • 14
  • 82
  • 112
1
vote
2 answers

sql query to update xml node stored in a column

I am working on a project where I am using a table which have xml data stored in one of its column.I am trying to update my entire xml node based on xml_id and position of xml node but I am unable to do that.I tried the following query but its only…
rupinder18
  • 795
  • 1
  • 18
  • 43
0
votes
1 answer

Using XML column in a where clause in SQL 2008

I have a stored procedure in which I need to have a where clause that reads something like: where XMLDataPoint <> NULL However, XMLDataPoint is an XML column and I get an error "The XML data type cannot be compared or sorted, except when…
user1111955
  • 459
  • 7
  • 19
1
2