3

I am trying to create a Database Project in VS2015 and get to build it. But I have errors like SQL71501: User: [UserX] has an unresolved reference to Login [UserX] Options are 1. To turn off any schema checking 2. Add Master Database as a Database project and Add it as a database reference.

I am unable to do (1) because I cannot find any options related to Schema Compare in Tools -> Options -> Database Tools I am able to add the Master Database as a project, but VS doesn't let me Import referenced logins (not applicable to master). Btw, I am trying to import a Sql Server 2014 database.

  • Are your logins/users the same in all environments? That makes a difference in how you may want to approach this. – Peter Schott Nov 04 '15 at 22:53
  • Yes. They are the same in all environments. Essentially I would like to not have my project depend on the Users/ Logins. – Rohit Nampelli Nov 09 '15 at 20:14
  • You have a couple of options - remove them from the project and handle separately or include the users/logins you use. You can create new logins for the project(s) pretty easily through the New Object options. We handled ours in post-deploy scripts and chose to ignore logins, users, and role members within the projects, but our logins were different in each environment. We used something similar to: http://schottsql.blogspot.com/2013/05/ssdt-setting-different-permissions-per.html – Peter Schott Nov 09 '15 at 23:23

1 Answers1

0

I am able to add the Master Database as a project, but VS doesn't let me Import referenced logins (not applicable to master)

You should try this

  1. go on "master" Database project, right click, then choose "Schema comparison...".
  2. In an opened window click "Options" (gear symbol)
  3. Extract "Non-Application-scoped"
  4. Mark "Logins" and click "OK"

Now Compare and Update

P.S. Of course before all you should choose you master database and do all other needed staff :).

I hope the answer helped (well it helped at least for me)

mybrave
  • 1,662
  • 3
  • 20
  • 37
Julius
  • 1
  • 1