Login Problem

  • 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..

  • Personally, I would restore master and msdb as well as attaching your user databases.

  • We dont have the backups of the master and msdb databases.

  • 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.

  • No I'm not able to add the login.It is saying that the suser or role already exists in the database.

  • Could you post the syntax you are using?

    I can do it no problem (just tested to ensure im not going insane)!

  • Thanks a lot Clive. It worked..

  • 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