May 30, 2007 at 10:04 pm
Hi,
A database was restored from backup to a new server. Now the database has users in it. Now there is a user lets say arun which is having windows authentication. Now since this has to be associated with the login arun then only the user can log on. Now when I create the login and grant it access to the database it says that user already exixts in the database. When i try to map the user using
sp_change_users_login 'update_one','arun','domain\arun'
I get error. It says that username arun is absent or invalid.
May 31, 2007 at 7:41 am
To get this to work create the user in security and do not grant access to the DB. It will casue the issue you are seeing and it only means the usaer exists in the DB not the system.
Once you have created the user in the system with default db of master you can then run the script and will work. Afterwards you may want to adjust any properties on the systems account such as default DB if you had set differently.
May 31, 2007 at 8:31 am
Will this work for a windows login also.
May 31, 2007 at 8:33 am
yes, it is a matter of mapping them into sqls logins first then attaching them to the db via sp_change_users_login. The user account in the db is technically an alias is all.
June 1, 2007 at 1:08 am
it is not mapping the nt user.
I tried to map it to sql login also but it also failed with the error that the user does not exists.
June 1, 2007 at 4:42 am
Hi,
We did the following steps. But for nt user we had to map it manually.
Regards,
Minaz
"More Green More Oxygen !! Plant a tree today"
June 1, 2007 at 9:26 am
I want to know how you mapped the nt logins manually. I'm not able to do that.
When I'm trying to dd the windows login and making the default db as the one in which the user exists it is not letting me create the user.
So I create the login and let the master db be the default db.
Now when i try to associate this login to the already existing user using sp_change_users_login gives error that the user does not exist.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply