To grant access to a user for a specific database, use the following commands:
Create a login (if it doesn't already exist):
CREATE LOGIN YourLoginName WITH PASSWORD = 'YourPassword';
Grant access to the database:
USE YourDatabaseName; CREATE USER YourLoginName FOR LOGIN YourLoginName;
Grant a role or specific permissions:
EXEC sp_addrolemember 'db_datareader', 'YourLoginName'; -- Grants read access