A database role for SQL Server is missing

The information in this article applies to:

  • Visual Studio Team Foundation Server 2010

  • Windows Server 2003 and Windows Server 2008 

  • SQL Server 2008

  • Application-tier and data-tier servers

  • Team Foundation Server Complete Health Check

  • Team Foundation Server Framework Health Check

The Best Practices Analyzer tool for Team Foundation Server verifies whether the TFSEXECROLE and TFSADMINROLE database roles exist and are assigned to the following databases:

  • Tfs_CollectionName

  • Tfs_Warehouse

  • Tfs_Configuration

The tool also verifies whether the service account for Team Foundation Server is a member of the TFSEXECROLE database role.

Note

The tool checks TFSADMINROLE only when Visual Studio Team System 2008 Team Foundation Server is installed. This role is not defined for earlier versions of Team Foundation Server.

One of the following errors appears if any of these database roles is missing or if the service account for Team Foundation Server is not a member of the TFSEXECROLE database role:

  • TFSADMINROLE is missing

  • TFSEXECROLE is missing

For the first two errors, the error reports which database and role are missing. For the last error, the error reports the service account that is missing as a member of the TFSEXECROLE role for the database that the error specifies.

To resolve this issue, you must add the missing database role or role member to the database that the message specifies.

Required Permissions

To perform this procedure, you must be a member of the Administrators security group for the Team Foundation databases.

To open SQL Server Management Studio

  1. Open the Start menu, point to All Programs, point to Microsoft SQL Server 2008, and then click SQL Server Management Studio.

    The Connect to Server dialog box opens.

  2. In the Server type list,make sure that Database Engine is clicked.

  3. In Server name, type the name of the server that hosts the databases for Team Foundation, and then click Connect.

    Note

    If SQL Server is installed on a cluster, type the name of the cluster and not the computer name. If you have specified a named instance, type the server and instance name in the following format: DatabaseServer\InstanceName.

    SQL Server Management Studio opens.

To add a missing database role

  1. Open SQL Server Management Studio.

  2. Expand Databases, and then expand the database that the message specifies (for example, TFS_CollectionName).

  3. Expand Security, expand Roles, and then expand Database Roles.

  4. Verify that the database role that the message specifies is not listed.

  5. Right-click Database Roles, and then click New Database Role.

  6. The Database Role - New dialog box opens.

  7. In Role Name, type the name of the missing role.

  8. In Owner, type dbo, and then click OK.

    The role appears under the Database Roles node.

To add a service account as a member role

  1. Open SQL Server Management Studio.

  2. Expand Databases, and then expand the database that the message specifies (for example, TFS_CollectionName).

  3. Expand Security, expand Database Roles, and then expand Roles.

  4. Right-click the role that the message specifies (for example, TFSEXECROLE), and then click Properties.

  5. In the Database Role - TFSEXECROLE dialog box, click Add.

  6. In the Select Database User or Role dialog box, click Browse.

  7. In the Browse for Objects dialog box, select the check box for the service account for Team Foundation Server check box, and then click OK twice.

  8. In Members of this role, verify that the service account for Team Foundation Server is listed, and then click OK.

See Also

Other Resources

Issues that Relate to SQL Server and the Team Foundation Database