Cleaning temporary database removes my permissions
RyanCooper
Posts: 5 New member
I'm trying to test the Invoke-DatabaseBuild cmdlet.
I have tried using Windows auth and sql auth. In both cases, I add my user to the db_owner role for the temporary database.
Then I run the cmdlet
The output is:
Cleaning database 'test_build' on server 'MyServer\MyInstance'.
I have tried using Windows auth and sql auth. In both cases, I add my user to the db_owner role for the temporary database.
Then I run the cmdlet
The output is:
Cleaning database 'test_build' on server 'MyServer\MyInstance'.
WARNING: The error 'The server principal "MyDomain\MyUser" is not able to access the database "test_build" under the current security context.' occurred when executing the following SQL:
@ERROR <> 0 SET NOEXEC ON
When i check the temporary database, I can see my user has now been removed from the database and therefore can't proceed with the build. How do prevent the clean database module from removing my user?
When i check the temporary database, I can see my user has now been removed from the database and therefore can't proceed with the build. How do prevent the clean database module from removing my user?
Tagged:
Best Answer
-
way0utwest Posts: 312 Rose Gold 1I don't think you can. Clean is clean, remove all objects because users are a part of what we deploy.
Editor, SQLServerCentral