all groups > sql server programming > june 2006 >
You're in the

sql server programming

group:

MS SQL 2000 - SQL Select with XPATH Where Clause


MS SQL 2000 - SQL Select with XPATH Where Clause Bryan
6/3/2006 4:56:02 PM
sql server programming:
In MS SQL Server 2000, is there an easy way to use an XPATH statement in a
WHERE clause? I have a table with a TEXT column that contains XML. I would
like to query this table and select any rows where the XML data field meets
my XPATH criteria.

I'm attempting to avoid using cursors and sp_xml_preparedocument on each row
of data in the table, but with SQL Server 2000, that may be my only option.

Re: MS SQL 2000 - SQL Select with XPATH Where Clause Erland Sommarskog
6/4/2006 5:11:24 PM
Bryan (Bryan@discussions.microsoft.com) writes:
[quoted text, click to view]

Yeah, upgrade the instance to SQL 2005. :-)

[quoted text, click to view]

OPENXML is on the only XML support that SQL 2000 offers. I agree that a
cursor and preparedocument for each is not appealing. The other alternative
would be to bring the data to the client, but is probably even less
appealing.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
AddThis Social Bookmark Button