Redgate SQL Change Automation Build commits suicide

Using the TeamCity integration, the "Redgate SQL Change Automation Build" build step, I'm trying to generate a NuGet package for deployment to multiple servers.

In the build step I have specified the server and temporary database name.
I have granted the TeamCity agent all rights (db_owner) on that database.

The build fails with the following in the log:

VERBOSE: SQLCompare.exe completed successfully.
VERBOSE: Altering schemas
VERBOSE: Dropping users
WARNING: The error 'The server principal "**server\username**" is not able to access the database "**dbName**"
under the current security context.' occurred when executing the following SQL:
@ERROR <> 0 SET NOEXEC ON

After this I added the user again and revoked the rights to change users and roles. Then the log went like this:

VERBOSE: SQLCompare.exe completed successfully.
VERBOSE: Altering schemas
VERBOSE: Dropping users
WARNING: The error 'Cannot drop the user '**server\username**', because it does not exist or you do not have permission.' occurred when executing the following SQL:
DROP USER [**server\username**]
VERBOSE: The database update failed
Invoke-DatabaseBuild : Failed to clean the database '**dbName**' on server '**servername**'.

Is there any therapy I can apply to help this suicidal user?
Tagged:

Best Answer

  • DanCDanC Posts: 641 Gold 5
    Just in case anyone comes across this issue, this was resolved by setting the Filter.scpf in TeamCity and overring the default, this then successfully filtered the user out from the project. 

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

Sign In or Register to comment.