Assign a login to a user created without login (SQL Server)

后端 未结 6 2008
逝去的感伤
逝去的感伤 2021-01-31 07:52

I have got a user in my database that hasn\'t got an associated login. It seems to have been created without login.

Whenever I attempt to connect to the database with t

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 08:09

    I found that this question was still relevant but not clearly answered in my case.

    Using SQL Server 2012 with an orphaned SQL_USER this was the fix;

    USE databasename                      -- The database I had recently attached
    EXEC sp_change_users_login 'Report'   -- Display orphaned users
    EXEC sp_change_users_login 'Auto_Fix', 'UserName', NULL, 'Password'
    

提交回复
热议问题