Created On: 29 April 2011
Problem:
StarTeam automatically drops and re-creates the StarTeam database views upon server startup. However, during an upgrade it may be necessary to correct any ownership issues with the views prior to completing an upgrade.
Resolution:
Run the following script in SQL Server management studio. Ensure "output as text" is enabled:
SELECT 'ALTER SCHEMA dbo TRANSFER ' SCHEMA_NAME(schema_id) '.' name
FROM sys.views
WHERE schema_id = SCHEMA_ID('starbase');
Replace 'starbase' with the current owner of the views to be amended.
This will generate a list of commands. Copy the commands generated, paste them into the query window and execute.
The ownership of the views will now be correct.
SELECT 'ALTER SCHEMA dbo TRANSFER ' SCHEMA_NAME(schema_id) '.' name
FROM sys.views
WHERE schema_id = SCHEMA_ID('starbase');
Replace 'starbase' with the current owner of the views to be amended.
This will generate a list of commands. Copy the commands generated, paste them into the query window and execute.
The ownership of the views will now be correct.
Incident #2512517