A database role for SQL Server is missing
The information in this article applies to:
Visual Studio 2005 Team Foundation Server
Visual Studio Team System 2008 Team Foundation Server
SQL Server 2005 and SQL Server 2008
Data-tier server
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:
TfsActivityLogging
TfsBuild
TfsVersionControl
TfsWarehouse
TfsWorkItemTracking
TfsWorkItemTrackingAttachments
TfsIntegration
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
TFS Service Account is missing from role TFSEXECROLE
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. As an alternative, you can repair the Team Foundation databases. For information about how to repair the databases, see Expected stored procedures are missing.
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
Open the Start menu, point to AllPrograms, point to Microsoft SQL Server 2005 or Microsoft SQL Server 2008, and then click SQL Server Management Studio.
The Connect to Server dialog box opens.
In the Server type list,make sure that Database Engine is clicked.
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
Open SQL Server Management Studio.
Expand Databases, and then expand the database that the message specifies (for example, TfsActivityLogging).
Expand Security, expand Roles, and then expand Database Roles.
Verify that the database role that the message specifies is not listed.
Right-click Database Roles, and then click New Database Role.
The Database Role - New dialog box opens.
In Role Name, type the name of the missing role.
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
Open SQL Server Management Studio.
Expand Databases, and then expand the database that the message specifies (for example, TfsActivityLogging).
Expand Security, expand Database Roles, and then expand Roles.
Right-click the role that the message specifies (for example, TFSEXECROLE), and then click Properties.
In the Database Role - TFSEXECROLE dialog box, click Add.
In the Select Database User or Role dialog box, click Browse.
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.
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