(
Select
b.ProjectID as '@ProjectID',
b.ProjectName as '@ProjectName' ,
b.StartDate as '@StartDate' from Projects b where a.EmployeeID = b.EmployeeID for xml path('Project'), type
) as 'Projects'
from Employee a
FOR xml PATH('Employee') , ROOT
It would give output like this:-
No comments:
Post a Comment