SQL Server: Error while Recycling the Errorlog.
Today while trying to recycle errorlog in one of the Production server, I got the below error: Unable to cycle error log file from ‘D:\SQL SERVER\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG’ to ‘D:\SQL...
View ArticleSQL Server: sp_syspolicy_events_reader – Cannot execute as the database...
Today I noticed that in one of the Production we were continuously getting the below same error: The activated proc ‘[dbo].[sp_syspolicy_events_reader]‘ running on queue...
View ArticleSQL Server: SQL Server 2000 DTS Runtime for SQL Server 2008 !!
Today one of my friend wanted to migrate SQL Server 2000 DTS packages to SQL Server 2008 but was finding it difficult to get all the required installation links that are required for the same. So I...
View ArticleSQL SERVER – Fix : Error : Msg 7311, Level 16, State 2, Line 1 Cannot obtain...
Today I was trying to run a query from a SQL Server 2008 R2 64bit Test machine which connects to a 32bit SQL Server 2000 Test machine through a Linked Server. When I tried running the query after...
View ArticleSQL Server : Timeout occurred while waiting for latch: class ‘LOG_MANAGER’ !!
Today in one of the Production Server we were continuously getting an error “Timeout occurred while waiting for latch: class ‘LOG_MANAGER'” and our application almost came to standstill. At early hour,...
View ArticleSQL Server: Error: 15138-The database principal owns a schema in the...
Today one of my reader asked a question about how to fix the error while trying to remove a login from a database. The reader was getting the below error: Msg 15138, Level 16, State 1, Line 1The...
View ArticleSQL Server: Throughput Benchmark !!
Today one of my reader mailed me which counters should be captured to create a baseline for measuring the throughput of SQL Server. As per me, two counters are sufficient to measure the throughput of...
View ArticleSQL Server: Prevent Accidental Database Drop with DDL Triggers !!
Today I am going to share a very simple yet useful piece of code that I have implemented in many SQL instances over the years to prevent the databases from getting dropped accidentally. One of the...
View ArticleSQL 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