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
What kind of database user is it? Run select * from sys.database_principals
in the database and check columns type
and type_desc
for that name
. If it is a Windows or SQL user, go with @gbn's answer, but if it's something else (which is my untested guess based on your error message) then you have a different problem.
Edit
So it is a SQL-authenticated login. Back when we'd use sp_change_users_login
to fix such logins. SQL 2008 has it as "don't use, will be deprecated", which means that the ALTER USER command should be sufficient... but it might be worth a try in this case. Used properly (it's been a while), I believe this updates the SID of the User to match that of the login.