Permissions required for Redgate SQL Source Control

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

The server instance Witness rejected configure request

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

Invoke-Sqlcmd : Object reference not set to an instance of an object.

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.

Arithmetic overflow error converting expression to data type int.

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.

The server principal owns one or more event notification(s) and cannot be dropped

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