Feb 10

Cursor Template

Most of the time when I use a cursor I find myself using the same template. I am always writing the same code so I figured I’d save myself 3 minutes each time I use a cursor and store the code here:


Feb 05

Permission to Read SQL Logs

Recently we had a group of DBA who have limited access on an instance. They wanted to view the SQL logs but were unable. I found it difficult to find a clear solution for this, but after some trial and error here is what I came up with:

Even after this you might get a message: The user does not have permissions to perform this action Error: 297.

In order to correct this you must grant VIEW SERVER STATE to the login:

Now the user or group should have access to view the SQL error logs.