Question: I'm facing error message 
Cannot Open database "XinInventory" requested by the login. The login failed. Login failed for user 'XinUser'.
How to solve it?



Answer: Please follow steps below to solve it.

  1. Download Microsoft SQL Server 2008 R2 RTM - Management Studio Express from http://www.microsoft.com/en-us/download/details.aspx?id=22985 and install in server. 

  2. After installation, go to All Programs -> Microsoft SQL Server 2008 R2, click on SQL Server Management Studio to start SQL Server Management Studio.

  3. Once SQL Server Management Studio started, in the Server Name field, enter localhost\SQLEXPRESS and try to connect. If connection failed, try to change tolocalhost\SQLEXPRESS2008.  Please check http://www.xininventory.com/determine-instance-name.html to check the correct server name if fail to connect.

  4. Once connected to database, click on Databases to expend the database. Then click to expend XinInventory. Under XinInventory, click to expend Security. Under Security, click to expend Users. We can see XinUser



  5. Right click on XinUser and click on Delete to delete this user.



  6. Now, click on collapse Databases then click on Security -> Logins. You will see XinUser



  7. Right click on XinUser and select property.



  8. In the popup window, click on User Mapping. Then select XinInventory database. In the database role membership, please select db_backupoperatordb_ownerpublic and click on OK button.



DONE