SQL Server General DBA

Select Based on List of Random Values — Dynamic SQL or CSV Parsing UDF?

Two frequently asked related questions in Microsoft SQL Server discussion groups are: How to pass an array to a stored procedure? How to select data based on a list of values? Examples: User wants to search for jobs based on a list of desired locations. User marks e-mails in an inbox for deletion. SQL data […]

Dealing with the Dodgy GO Command

The GO command plays a very important role in Microsoft SQL Server. It signals the end of a batch of SQL statements and executes them as a whole. Seems simple enough. But using GO can be disastrous if you don’t understand its usage in a certain scenario. One of the places where I found the […]

Scripts for Space Monitoring Report

The SQL to enter in the “Execute SQL Task” if not exists(select * from master..sysdatabases where name=’dbamaint’) create database dbamaint go alter database dbamaint set RECOVERY SIMPLE go use dbamaint go if exists (select * from dbo.sysobjects where id = object_id(N’[dbo].[sp_filespacestats]‘) and OBJECTPROPERTY(id, N’IsProcedure’) = 1) drop procedure [dbo].[sp_filespacestats] GO SET QUOTED_IDENTIFIER ON GO SET […]

Monitor Your Database Servers with DTS, Part 3: Space Monitoring of SQL Servers

In the previous two articles in this series on monitoring a large number of servers from a centralized location using Data Transformation Services (DTS) (see Part 1 and Part 2), I explained how to set up a report to ensure that backups are happening as per the backup policy and how to monitor SQL Server […]

Generate Log Files with a Trigger

As a DBA you try to supply data in a format that is familiar to the audience you’re presenting it to. Many times, you’ll present data in MS Excel to the accounting department, or an HTML report to a standard user. Your system and security administrators are no different; they are used to reading logs […]

SQL 2000 to SQL 2005: Where Have All the Old Features Gone?

As more DBAs across the planet begin using SQL 2005 Tools, but still manage SQL 2000 servers with them, I suspect there will be lots of muffled moaning as to where all the good old features have gone. Although Management Studio has some very nice long-awaited features, some of the good old stuff just isn’t […]

Scripts for Errorlog Monitoring of SQL Servers

The text for the batch file: errorlog_chk_1.bat ============ Text of the batch file ====================== @echo OFF @if not “%ECHO%”==”” echo %ECHO% rem ******************************************* rem Script : errorlog_chk_1.bat rem Author : Neeraj Nagpal rem Date : 02/01/2005 rem ******************************************* rem Set Local scope and call main proc. setlocal & pushd & Set RET= set SCRIPTNAME=%~n0 set […]

Monitor Your Database Servers with DTS, Part 2: Errorlog Monitoring of SQL Servers

In the first article in the series, I explained the setup of a report that ensures that backups are happening as per the backup policy. In this article, I will explain how to monitor SQL Server errorlog, leveraging the capabilities of DTS. Just in case you have not read the first article, in this series, […]

Scripts for Backup SLA Report

########## Bkp_sla_main.bat ###################### @echo OFF @if not “%ECHO%”==”” echo %ECHO% rem ******************************************* rem Script : Bkp_sla_main.bat rem Author : Neeraj Nagpal rem Date : 10/08/2004 rem ******************************************* rem Set Local scope and call main proc. setlocal & pushd & Set RET= set SCRIPTNAME=%~n0 set SCRIPTPATH=%~f0 set DBASQL=E:dbaSQL set DBAOUT=E:DBAout set DEBUG=1 if “%DEBUG%”==”1″ (set TRACE=echo) […]

Monitor Your Database Servers with DTS, Part 1: Backup SLA Report

It is difficult to keep track of critical things like backup, space, and error logs in large environments. Different database management tools from third party vendors can help you monitor these but the tools are normally expensive. There is an inexpensive alternative. In this series of three articles, I will describe how to monitor a […]
Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |