More Related Content
Similar to Sql2005 xml (20)
Sql2005 xml
- 1. XML Enables SQL Server to be a Complete Data PlatformExploit the XML Capabilities of SQL Server 2005 by Jason Follas
- 13. XML Enables SQL Server to be a Complete Data PlatformExploit the XML Capabilities of SQL Server 2005 by Jason Follas
- 17. XML translation in middle-tier can be inflexible and may even increase network overhead
- 22. XML is a First-Class Citizen data type INT DATETIME VARCHAR XML
- 53. RAW Mode SELECT * FROM Employee FOR XML RAW('Employee') <Employee EmployeeID="2" Federal_ID="000-00-0001" Name="Andrew Miller" DOB="1968-05-01T00:00:00" StartDate="2000-01-01T00:00:00" ManagerFK="3" /> <Employee EmployeeID="3" Federal_ID="000-00-0002" Name="Bert Parkins" DOB="1947-12-31T00:00:00" StartDate="2000-01-01T00:00:00" />
- 54. AUTO Mode SELECT * FROM Employee FOR XML AUTO <Employee EmployeeID="2" Federal_ID="000-00-0001" Name="Andrew Miller" DOB="1968-05-01T00:00:00" StartDate="2000-01-01T00:00:00" ManagerFK="3" /> <Employee EmployeeID="3" Federal_ID="000-00-0002" Name="Bert Parkins" DOB="1947-12-31T00:00:00" StartDate="2000-01-01T00:00:00" />
- 55. Nested FOR XML Queries SELECT [EmployeeID], [Name], ( SELECT [EmployeeID], [Name] FROM [Employee] WHERE ManagerFK = E.EmployeeID FOR XML AUTO, TYPE ) DirectReports FROM [Employee] E FOR XML RAW('Employee') <Employee EmployeeID="2" Name="Andrew Miller"> <DirectReports> <Employee EmployeeID="5" Name="Dave Murrel" /> </DirectReports> </Employee> <Employee EmployeeID="3" Name="Bert Parkins"> <DirectReports> <Employee EmployeeID="2" Name="Andrew Miller" /> <Employee EmployeeID="4" Name="Brad Barnes" /> </DirectReports> </Employee>