Hi @kirankumar-3620,
Error 916 means the login does not have sufficient permissions to connect to the named database.
Try code as next to check whether the user have connect permission:
SELECT * FROM sys.database_principals dprinc
INNER JOIN sys.database_permissions dperm
ON dprinc.principal_id = dperm.grantee_principal_id
WHERE dprinc.name = '<username>' AND dperm.permission_name = 'CONNECT'
And if not, grant connect permission as next:
USE Dbname
GO
CREATE USER UserName FROM LOGIN LoginName /*if you already have one, you can skip this step*/
GO
GRANT CONNECT TO UserName
GO
Note: The login “LoginName” needs set up in the database as a "User". By default, all users are a member of the database public role.
BR,
Mia
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.