Background
There are multiple vendor databases on the client's SQL Server instance, each of which is maintained by the respective factory provider,
In order to limit the maintenance personnel of different vendors to access their own databases, it is necessary to restrict the permissions to each vendor so that they can log on to SQL Server only to see the authorized database and not see other databases.
Solution Solutions
1. Create a different login name for each vendor (see below for a vendor example)
2. Add the login name to the public server role and click OK
3. Assign the Dbowner of the database to be authorized to that user
Use [xjcs] Go EXEC dbo.sp_changedbowner N'provider1'
When you log in to SQL Server with ' provider1 ', you can only see the specified user database (except the system database)
Description
I previously wanted to set up a user mapping for the login in the 2nd step to implement this requirement, such as, but no effect, after logging into SQL Server or not seeing the user database,
So the above method is used:
How to enable users to access only specific databases (MSSQL)