SQL Server: Storing Output of DBCC Statement in a Temp Table !!
In few servers, we have hundreds of databases and sometimes it is tiresome and time-consuming activity to find the output of a DBCC command such as DBCC SQLPERF(Logspace) for a particular database. For...
View ArticleSQL Server: Find all Stored Procedures that run at SQL Startup !!
We can mark a Stored procedure to run when SQL server starts. For this to happen, we need to do the following: Create the Stored Procedure in the Master database We have to set the Startup flag for...
View ArticleSQL Server 2005: Database Mail not working !!
Today we patched and upgraded one of our production SQL Server from SQL Server 2005 SP2 to SQL Server 2005 SP4. After upgrade our Database Mail that was configured to send mails from SQL Server stopped...
View ArticleSQL Server: Mirrored Database Backups !!
One of my DBA friend asked me if there is any other tool besides Robocopy to transfer database backups from Production Instance to another server for safekeeping. I asked him if he is aware that this...
View ArticleSQL Server: SQL Agent Jobs getting Suspended State!!
Today we had to do some maintenance on one SQL Server and had to restore MSDB database. After restoring MSDB database we found that few of our SQL jobs were in Suspended state and we could not re-run...
View ArticleSQL Server: Removing Secondary Data File from Database !!
Today I want to show you how we can remove secondary data file from a database, now to do this, we need to first move the data from that file to other files in the same filegroup. In below example, we...
View ArticleSQL Server tablediff Utility !!
Tablediff utility is one handy tool that I use in my day to day life as DBA to compare the data of one table against another table to identify if there are any differences between the tables. We can...
View ArticleSQL Server: Stop Trace using SQL command !!
Recently, we were experimenting with one of the 3rd party tool in our environment that internally creates Traces. After sometime, there was some issue with the 3rd party tool and we stopped using it...
View ArticleSQL Server: Database Mail Error “Activation failure” !!
Recently in one of our legacy server running SQL Server 2005 SP2, I noticed that database mail was not working and was not sending any mails. In database mail log, it was showing “Activation failure”...
View ArticleChecking SQL Service Running Status !!
Today I want to share one script that I use very frequently through Central Management Server to monitor the SQL services current running status. This script will work from SQL Server 2008R2 SP1 onward...
View Article