Querying Databases in SQL Server 2005 - XML Queries, a Comparison
(Page 4 of 4 )
In SQL Server 2000, Microsoft added T-SQL enhancements so that it can support getting XML into the database and getting XML out of the database. However, the support was not sufficient. Fig. 8 shows the result of running a for XML query in SQL Server 2000. Depending on the number of maximum characters allowed in the results, this could get even uglier.
Fig. 8
The same query in Studio is shown for comparison in Fig. 9. Now the result is shown with a hyperlink. Clicking on the hyperlink takes you to the hyperlinked XML document, albeit a fragment as shown in Fig.10. The <root> is still missing, but it's better than before. A more comprehensive discussion of XML support in Studio is not within the scope of this article.
Fig. 9
Fig.10 
The Tools menu is also useful for setting other Query related items like ANSI_Defaults, and query execution related items as seen in the next two pictures. You may also configure to open new queries in SQLCMD mode if you so desire.
Fig. 11
Fig. 12

Summary
SQL Server 2005 shows the excellent manner in which several scattered tools in the previous version are integrated. Besides conferring total support for XML which is not discussed in this tutorial, the for XML clause a la SQL Server 2000 has been improved enormously by the hyperlink. By providing SQLCMD support, Microsoft will successfully transition developers from Osql to SQLCMD, as it is so much more convenient. In SQL Server 2000 you needed to click on object browser; this is now redundant because the objects are visible. Only some major improvements were covered in this tutorial; the reader will probably discover many more.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |