none
SQL Query to retrieve Project Team

    Pertanyaan

  • Hi,

    how can I retrieve the team of a project through an t-sql query in Project Server 2016? I do not want to use oData, CSOM and I'm aware that this info is not in reporting schema and rather in the published or draft schema.

    Thanks for any advice

    John


    John

    31 Agustus 2018 13:16

Semua Balasan

  • Hi John

    Below SQL Query gives list of resources which is part for project team for given projectUID

    select * from pjpub.msp_project_resources where proj_uid = '<ProjectUID>'

    Is this one looking for ?

    Regards

    Santosh


    31 Agustus 2018 16:03
  • Hi John,

    CSOM / REST / JSOM are the only supported methods to get this data - what is the issue with using these APIs?

    Paul


    Paul Mather | Twitter | http://pwmather.wordpress.com | CPS | MVP | Downloads

    03 September 2018 21:53
    Moderator
  • Hi John,

    We can read Project Team data using CSOM/JSOM also. Below is the JSOM Sample code to read the given project's Team data.

    function ReadProjectResource() {
         projectContext = PS.ProjectContext.get_current();
         Allprojects = projectContext.get_projects();
         project=Allprojects.getById(projectID);
         ProjectResources = project.get_projectResources();
         projectContext.load(ProjectResources);
         projectContext.executeQueryAsync(ReadProjectTeam,errorHandler);
    }

    function ReadProjectTeam() {
        var ResEnum=ProjectResources.getEnumerator();
        while(ResEnum.moveNext()){
            var resourceInfo = ResEnum.get_current();
            alert("Res ID: " +resourceInfo.get_id() + " and Resource Name : "+ resourceInfo.get_name())
        }
    }

    Hope this will help you.


    04 September 2018 6:55