SQLjobvis is a tool I’ve blogged about before. For more info on what SQLjobvis is and how it can help you you can read my blog post here. A reader had commented on that post and mentioned that they didn’t have the necessary permissions to run SQLjobvis. But what are those permissions? The website doesn’t appear to
Continue reading Permissions required for SQLjobvis
Who is Active? Not I! 3 blog posts in 2014, all published in the beginning of the year. However in 2015 I’ll be looking to change all that. Back to SQL! Who is Active, an awesome stored procedure I use on a daily basis to see what is going on, at that very moment, on
Continue reading What I Use – sp_WhoIsActive
In order to execute queries under a different security context (such as another login) using the EXECUTE AS clause, you must be able to impersonate the user. To grant impersonate permissions on a specific login, run the query below. To test this works you can run the query below.
A user will usually receive this error message when trying to execute xp_cmdshell and does not have sufficient permissions. To grant permissions to execute xp_cmdshell using TSQL, run the query below. To test this works I usually run the query below. To test the granted execute permissions work for the intended user, I impersonate them
Continue reading The EXECUTE permission was denied on the object ‘xp_cmdshell’, database ‘mssqlsystemresource’, schema ‘sys’
Redgate SQL Source Control is a SSMS plug-in which allows you to source control your database schema. Assuming you or your users have limited access, some permissions are required to use this application. At a database scope the VIEW DEFINITION permission is required to view code changes which have not been committed. ALTER is also
Continue reading Permissions required for Redgate SQL Source Control
I noticed the following message in the SQL Server ErrorLog for one of the database servers which is in a database mirroring setup (currently the mirror). Error: 1438, Severity: 16, State: 2 The server instance Witness rejected configure request; read its error log file for more information. The reason 1427, and state 31, can be
Continue reading The server instance Witness rejected configure request
Today I was working on some PowerShell scripts where I ran into the following error message: Invoke-Sqlcmd : Object reference not set to an instance of an object. Below is the PowerShell code which was throwing the error. I discovered the culprit was the $Query parameter. The $Query parameter contents contained a TSQL query to
Continue reading Invoke-Sqlcmd : Object reference not set to an instance of an object.
Update: Instead of a script arsenal page, I have decided to create a What I Use page. This will not only hold scripts but other tools I find useful. I’ve also included a link to download the sp_Blitz stored procedure. Every DBA should have their own script arsenal, a set of TSQL scripts you use
Continue reading Script Arsenal
While trying to execute the below TSQL query I got the following error message: SERVERNAME(User): Msg 8115, Level 16, State 2, Line 1 Arithmetic overflow error converting expression to data type int. I gathered that I was receiving this error message because the SUM of the SQL Server database files was larger than the maximum
Continue reading Arithmetic overflow error converting expression to data type int.
Earlier this week I ran into an issue while executing a DROP LOGIN statement. This would result in the following error message. Msg 15141, Level 16, State 1, Line 2 The server principal owns one or more event notification(s) and cannot be dropped. In order for me to drop the login, I also needed to
Continue reading The server principal owns one or more event notification(s) and cannot be dropped