I have a view that's selecting rows from a table on a different database. When calling this view from my application I get an inner exception thrown saying the application user is not able to access the database being referenced. How do I grant permissions to this user on the separate database? I've tried it the traditional way but of course that user role wasn't found of that db. Should I create a user with the same name on the other db, this doesn't seem like it would work. I haven't been able to find a solution for this specific instance.
Open SQL Server Management studio 2008.
Expand the server instance > Security > Logins > and locate the log in you have having an issue with.
Right click the user and select Properties.
Select User Mappings.
Locate the database you want the user to have access to and check the checkbox in the map column.
Set the correct database membership for this user and click OK.
Try your code again, be sure to qualify the path properly like