Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » XQuery » SQL Server   (RSS)
The Performance Optimizations for XML Data Type in SQL Server 2005 whitepaper written by Shankar gives some pretty good advice for writing your XQuery statements so that they take advantage of an available XML Index. However, oftentimes you will have Read More...
Usually there are a couple of scenarios in which you want to take XML data and convert it into a regular relational rowset. In SQL 2000, you probably used OpenXML for this, which works pretty well if you are only working on a single piece of XML data, Read More...
XML Schema has an interesting feature where you can define a value as being "fixed" . The meaning here is basically that an attribute or element has to have a particular value, and if it is not there in the instance, then that value is implied. However, Read More...
A little while ago I threw out this quiz regarding XML and SQL Server 2005's full text search support. As I stated in the quiz, there is a subtle difference between what you can get with contains() and the fulltext support. Specifically, the difference Read More...
Using SQL Server's fulltext engine is a great way to optimize your XQuery statements which use XQuery's contains function in a predicate . However, a bit of care has to be taken, because sometimes you might get results which you don't quite expect. Let's Read More...
The XQuery/XPath 2.0 functions and operators specification defines a function called “contains.” It performs a substring match on the two input strings and returns true if the value of the 2nd string is contained in the value of the 1st string. An example: Read More...
People used to write "Hello, World!" applications in order to demo new languages and technologies. It seems that all of the demos de jour are RSS applications. Well, in order to continue the trend, I have decided to write a quick RSS reader which uses Read More...
This might be long, so I am going to cut to the chase right now. If you are using predicates which involve non-string types in your XQuery statements, you want to use typed data. There, I said it. Now lets try to figure out why. The issue basically boils Read More...
One error that you may run into when attempting to create a Primary XML Index is the following: Msg 6336, Level 16, State 201, Line 1 Maximum size of primary index of table 'StorageTable' is 900 bytes. CREATE XML INDEX requires that such size should be Read More...
Check out Mike's entry regarding namespaces in XQuery. I wanted to illustrate one more point regarding the consequences when namespace prefix bindings affect both query and construction. It is about the default element namespace. The real problem hits Read More...
Last week I threw out this simple little quiz . Here is the answer. The first query will return 1 or 0 rows, depending on what the default collation in your database is. On my machine, which uses the default out-of-the-box collation "SQL_Latin1_General_CP1_CI_AS" Read More...
I have the following two statements. What is the difference? What would you expect the results to be? Are you surprised by what you get? select 1 where convert(xml, '<foo>bar</foo>').value('/foo[1]', 'nvarchar(4)') = 'Bar' go select 1 where Read More...
Denis is one of my fellow SDETs on the SQL Server Engine team. He just started a blog about XSD in SQL Server. http://blogs.msdn.com/denisruc/archive/2005/06/13/428726.aspx Static Typing is one of those things that causes a bit of confusion at first for Read More...
Last week I threw out a quick quiz about the XML datatypes 'exist' method. The reason it was at the top of my mind was that it was a mistake that I had made only a couple of days before. Not only that, but even a couple of my peers didn't recognize the Read More...
Among the features introduced in SQL Server 2005 is the new XML Datatype . You can use this guy to store both untyped and typed XML information and maintain the infoset fidelity of the document. We support a subset of the XQuery language which can be Read More...
 
Page view tracker