TYPE directive of FOR XML

          

TYPE directive of FOR XML

<<Previous   Next>>

TYPE directive of FOR XML - March 14, 2009 at 15:50 PM by Amit Satpute

Discuss the TYPE directive of FOR XML with an example 

SQL Server 2000 always returns the result of a FOR XML query directly to the client in textual form. 

SQL Server 2005 enables you to optionally request that the result of a FOR XML query be returned as xml data type by specifying the TYPE directive. 

This allows you to process the result of a FOR XML query on the server. 

If the TYPE directive is not specified, the FOR XML query result is returned as type nvarchar(max).

Eg:
SELECT CID, NAME, PHNO
FROM EMPLOYEE
ORDER BY CID
FOR XML AUTO, TYPE 

<<Previous   Next>>
 



Write your comment - Share Knowledge and Experience


 

 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring