Setting up project from existing database without database users

I am trying to set up an SCA project from an existing customer database which contains database users defined in their domain.

When I try to import and generate scripts, it creates a migration script which starts off by trying to create logins and then database users for each of those users. The validation step then errors because it can't create the logins from a domain it can't access.

I have tried omitting "User" from the SyncToOfflineSchemaModelObjectTypes setting but it doesn't prevent this from happening. What's the best way to set up a project in these circumstances?


Best Answer

  • Kendra_LittleKendra_Little Posts: 139 Gold 3
    Hi @nharris18,

    There are two configuration changes you might wish to make:

    1) Add a filter file to exclude users. This will prevent SQL Change Automation from scripting users out from the database. I've attached a sample SQL Compare file if that saves you time.

    2) Set the project option SyncOptionIgnoreUsersPermissionsAndRoleMemberships to True (default is False / do not ignore these)  in your sqlproj file.  This will prevent SQL Change Automation from scripting out GRANT scripts for users who are members of roles. If you don't want the users scripted, you probably also don't want their role permissions scripted. 

    Hope this helps and I'll have a look at the documentation to see if there's a sensible place to add this which might show up for folks in search results when they hit this question.



Sign In or Register to comment.