What should you do?

You are a database developer. You plan to create a database by using SQL Server 2008.
The database has a table named Employees. The table contains records of employees and their managers.
The table includes the EmployeelD and ManagerlD fields. The EmployeelD values are unique. The value in the ManagerlD field is the employee ID of the employee’s manager.
A Web site requires XML formatted output of all managers and employees to be displayed as a tree diagram.
You need to produce the required output by querying the database without using system stored procedures.
What should you do?
A. Create a table-valued function by using the hierarchyid data type.
B. Create a scalar-valued function by using the FOR XML PATH clause and the TYPE directive.
C. Create a table-valued function by using a common table expression (CTE).
D. Create a scalar-valued function by using the OPENXML() function.

microsoft-exams

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.