We come up with one of our client reports that approach SQL error 300.
Where he was unable to execute some of the queries and facing “VIEW SERVER STATE permission denied on the object ‘server’, database master (SQL error 300) while executing the script.
The error occurs when the script doesn’t have VIEW SERVER STATE permission
As a part of our server management services, we use to handle several such SQL-related issues for web hosts and online service providers.
You can consult our technical team support for further assistance.
Fixing SQL error 300
Let’s have a glance at how we resolve the error with help of our technical team support.
Since the script doesn’t have VIEW SERVER STATE permission, you can fix the error by providing access permission to the login name.
Use two methods to assign the permission
1. Assigning permissions using GUI in SQL Server Management Studio
1. First >>launch SQL Server Management Studio.
2. Next,connect to >> SQL Server Instance.
3. Then navigate to the Security folder and expand Logins.
4. Later, right-click at our login name and choose Properties.
5. Click on the Securables tab from the left side pane.
6. Scroll down to the grant option for the View server state value.
7. Click >> APPLY >> close the window.
8. Finally test the script.
2. Assigning permissions using T-SQL statement in SQL Server Management Studio
1. First, launch SQL Server Management Studio and connect to the SQL Server Instance.
2. Open >> New Query window
3. Run the below T-SQL statement:
USE master
GO
GRANT VIEW SERVER STATE TO “LoginName”
Once you have executed the command, now you can see the view server state permission on the login name.
Conclusion
In short, follow the step to resolve the SQL error. If you need further assistance, now you can consult our technical team support for any sort of issue.