In order to run a trace against SQL Server you must be a member of sysadmin fixed server role or have the ALTER TRACE permission.

-- To Grant access to a Windows Login
USE Master;
GO
GRANT ALTER TRACE TO [DomainNAME\WindowsLogin]
GO

-- To Grant access to a SQL Login
USE master;
GO
GRANT ALTER TRACE TO mysqlacct
GO
-- REVOKE access FROM a Windows Login
USE master;
GO
REVOKE ALTER TRACE FROM [DomainNAME\WindowsLogin]
GO

--REVOKE access FROM a SQL Login
USE Master;
GO
REVOKE ALTER TRACE FROM mysqlacct;
GO

Sources:

https://www.mssqltips.com/sqlservertip/3559/how-to-grant-permissions-to-run-sql-server-profiler-for-a-non-system-admin-user/

https://learn.microsoft.com/en-us/sql/tools/sql-server-profiler/permissions-required-to-run-sql-server-profiler?view=sql-server-ver16

Last modified: January 3, 2024

Author

Comments

Write a Reply or Comment