SQL Server / SQL Server Management Studio could not delete the Secondary server / Secondary not available

SQL Server / SQL Server Management Studio could not delete the Secondary server / Secondary not available
Most of the time it is very easy to remove secondary server from your log shipping configuration. But what happens if secondary server is not available.   We had this case on one of our testing environment, we had secondary server on the cloud and after a month server lease expired. When we tried to remove that server from our log shipping configuration we end up with following errors.   Error details   As you can see from error details SQL Server Management Studio could not delete the Secondary server ‘SQLNODE2’....
read more

SQL Server / Missing Indexes Query / Email Alert

SQL Server / Missing Indexes Query / Email Alert
This is example of missing indexes of database within email alert, we already had example how you can use sp_send_dbmail stored procedures from msdb database to send backup size email daily, and this example is just to show use case with different scripts. I used following arguments to achieve this @profile_name (name of an existing Database Mail profile, type sysname, default NULL), @recipients (Is a semicolon-delimited list of e-mail addresses to send the message to, varchar(max)), @body (Is the body of the e-mail message, nvarchar(max)),...
read more

SQL Server / The target principal name is incorrect. Cannot generate SSPI context

SQL Server / The target principal name is incorrect. Cannot generate SSPI context
One of our old SQL servers was running under the local system context. Then we decided to change the account that the SQL service runs under, and we created domain service account with basic domain user permissions. Eventually, we end up with following error trying to access our SQL Server remotely.   SQL Server SPN Creation To run SQL Server service you can use Local System account, local user account or a domain user account. If you are using Local System account to run your SQL Service the SPN will be automatically registered. ...
read more