Query in SQL Database Logins

chandrurecchandrurec Member Posts: 560
Hi all,

I have created logins first in sql generic login , then I am going to restore the database and tag the database login to the newly restored database. Is it adcisable to create the login first then tag it to the database or it will not work.

Thanks in advance.

Regards,
chandru.

Comments

  • evildaveevildave Member Posts: 21
    Hi,

    When you restore the database the logons are only restored to that specific databases security section. e.g if you have no accounts specified in SQL - Security when you restore a database you will STILL have no logons after the database is restored. If you then try to create the logon and link it to the database it will fail saying that the SQL user already exists within the database (might also get a schema error in some cases). If i remember correctly, creating the users within the SQL security before restoring the database should be fine but a built in SQL stored proceedure needs to be run to tie the login ID's together, i think its called user_login_change? although i may be wrong on the naming.
Sign In or Register to comment.