July 27, 2006 at 4:49 am
Hi
The Sql server develeoped some problem and so we had to reinstall it again. The steps taken were that we detached all the databases and then installed sql server and then attached the databases back.Now the problem is that when I try to create the logins again then it gives error that user already exists.If i check in security I dont find the login but when I check in partidular databases then the suer is lying in the roles which were given to it.
Now How do I create this login again with the same name..
July 27, 2006 at 4:57 am
Personally, I would restore master and msdb as well as attaching your user databases.
July 27, 2006 at 5:03 am
We dont have the backups of the master and msdb databases.
July 27, 2006 at 6:38 am
You can use sp_addlogin to add a login to the master database. However, if you specify the user database then you will get an error saying the user exists.
You should be able to add the login using sp_addlogin, and then use sp_change_users_login to map the new login to the existing user.
July 27, 2006 at 6:56 am
No I'm not able to add the login.It is saying that the suser or role already exists in the database.
July 27, 2006 at 7:05 am
Could you post the syntax you are using?
I can do it no problem (just tested to ensure im not going insane)!
July 27, 2006 at 7:49 am
Thanks a lot Clive. It worked..
July 27, 2006 at 7:55 am
Well the login has been created and I have associated with the suer also but now there is one more problem when In EM>>Security>>Login--I click on this login then it gives the error message
"Error--21776:[Sql DMO] The name 'Script' was not found in the users collection.If the name is a qualified name , use [] to separate various parts of the name and try again."
When I click on OK it opens the login and its properties but why it is giving this error message.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply