Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

XQuery vs OpenRowset
Please let me know the advantages and disadvantages of XQuery vs
OpenRowSet in SQL Server 2005. Which would be better?

Regards,
Shilpa


Report this thread to moderator Post Follow-up to this message
Old Post
Shilpa
04-05-06 02:30 PM


Re: XQuery vs OpenRowset
Shilpa (shilpa.nagavara@unisys.com)  writes:
> Please let me know the advantages and disadvantages of XQuery vs
> OpenRowSet in SQL Server 2005. Which would be better?

I'm by no means an expert on XML, but I would say that XQuery is
preferrable for all new code that you write. It may not be worth
to rewrite legacy code just for the sake of it.

A major advantage is that you don't need this  sp_xml_preparedocume
nt
with XQuery.

Of course, if all you want to do is to unpack an XML document, using
nodes() and CROSS APPLY may feel bulkier, at least initially when the
new syntax may feel akward. Then again, XQuery permits you to do a
lot more things that OPENXML does not, so that you can query an XML
document withour shredding it.

There is one situation you will have to stick to OPENXML, and that is
if you for for some reason are running with any of the options
QUOTED_IDENTIFIER, ANSI_NULLS, ANSI_WARINGS, ANSI_PADDING or
 CONCAT_NULL_YIELDS_N
ULL off. They must be on for XQuery. Note that some
of these options are sticky with stored procedures or table columns.


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

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Report this thread to moderator Post Follow-up to this message
Old Post
Erland Sommarskog
04-06-06 01:26 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 08:12 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006