====== SQL Server - "Managing database users and logins" ====== In Microsoft SQL Server there are two forms of "User ID's": - There is a SQL Server "Login" which aloows the user to connect to the SQL Server. This data is usually found under the "Security" folder. - Under the Databases --> --> Security --> Users folder are the users that are allowed to access the database in question. **Question**\\ What happens when you are restoring a foreign database into your SQL Server. The Database has a set of users allowed to access it but there is no corresponding SQL Server "Login"? **Answer**\\ This is where **sp_change_users_login** comes into play. There are two main ways to use the stored procedure: \\ * The following code block shows you how to automatically create a "Login" for the "User" in your recently restored database. use go exec sp_change_users_login 'Auto_Fix', '',NULL,'' go * The following code block associates the "User" in the database to an existing "Login". use go exec sp_change_users_login 'Update_one', '','' go