"Unresolved reference to User" after importing as a VS DB project
15
votes
3
answers
37088
views
I just imported an existing SQL Server 2008R2 production database into a VS 2013 database project.
I now get a number of errors along the lines of
Error SQL71501:
User: [mydbuser] has an unresolved reference to Login [mydbuser].
I don't really need my VS DB project to manage users, but I'm concerned that it would try to remove them upon deploy if they weren't there.
The files themselves are generated as
CREATE USER [mydbuser] FOR LOGIN [mydbuser];
or
CREATE USER [mydomainuser] FOR LOGIN [MYDOMAIN\mydomainuser];
The error marker shows that it's specifically for the **Login**.
As that's a system-level object, I can understand it being outside the scope of the db project.
Is it preferred that I change them all to
CREATE USER [mydbuser] WITHOUT LOGIN;
or add the
CREATE LOGIN
clause to the beginning of each file?
Removing the Login reference seems to be simpler and removing the users altogether would be the simplest.
I want to make sure that I'm using the tool the way it was intended.
- Will there be any issues in re-publishing any of those back to production?
- What is the proper procedure for adding a user/login via a project?
Asked by Greg
(407 rep)
Jul 20, 2015, 08:19 PM
Last activity: Oct 14, 2022, 09:51 PM
Last activity: Oct 14, 2022, 09:51 PM