Database Package Creation Fails on Validation

##[warning]The error 'Cannot find the user 'ODSViewer', because it does not exist or you do not have permission.' occurred when executing the following SQL:
2018-01-16T23:50:57.4416088Z GRANT SELECT ON [dbo].[ActiveDirectoryImport] TO [ODSViewer]
2018-01-16T23:50:57.7087918Z ##[error]RedGate.DLMAutomation.Shared.Errors.TerminatingException: Schema validation failed: Cannot find the user 'ODSViewer', because it does not exist or you do not have permission. ---> System.Data.SqlClient.SqlException: Cannot find the user 'ODSViewer', because it does not exist or you do not have permission.
2018-01-16T23:50:57.7087918Z

ODSViewer is a Role - I have the following script: (Security/Roles)

CREATE ROLE [ODSViewer]
AUTHORIZATION [dbo]
GO

Note that I have to ignore Users as they are different per environment
Tagged:

Answers

  • This error was happening because the role was being excluded from a filter, however there was an object permission that referenced it.

    The issue can be resolved by using the SQL Compare Option "IgnorePermissions"
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
Sign In or Register to comment.