Category: TSQL

Return Default SQL Server Folder

Below script will query registry settings to return folder informations (SQL Root, Data, Log and Backup). I use this script to determine the default locations, put it in variables an use it for creating databases or backups. more »

SQL Server 2005 and 2008 - Backup, Integrity Check and Index Optimization

SQL Server 2005 and 2008 - Backup, Integrity Check and Index Optimization more »

SQL Server 2005 and 2008 - Backup, Integrity Check and Index Optimization

SQL Server 2005 and 2008 - Backup, Integrity Check and Index Optimization more »

German translation of Tibor Karaszi`s updated datetime article

German translation of Tibor Karaszi`s updated datetime article more »

List all tables with specified field

DECLARE @COL_NAME NVARCHAR(50)SET @COL_NAME = '%SOMESTRING%'SELECT DB_NAME(DB_ID()) AS DatabaseName, B.name AS TableName, A.name AS ColumnNameFROM sys.syscolumns AS A INNER JOIN sys.sysobjects AS… more »

BgInfo, WMI and SQL Server

BgInfo from Sysinternals (now Windows Sysinternals, by Mark Russinovich) automatically displays relevant information about a Windows computer on the desktop's background, such as the computer name, IP address, service pack version, and more interesting f… more »

SQL Server Automation Scripts

The Microsoft SQL Server Community introduces a new OPSDB Section (SQL Server Automation Scripts), with T-SQL Scripts for administration and analysing the entire SQL Server. You can visit OpsDB Section here. CUtosc more »

Did you track the growth of your database-backup?

Frequently you'll want to know how fast your database-backup has been growing. Perhaps you have implement a SAN Backup-Device for Backup-to-disk, or you only want know how fast your database has been growing. This TSQL statement will query the [msdb]..[b… more »

SQLExamples: Common Solutions for T-SQL Problems

There is a new great WIKI ressource for common T-SQL solutions at MSDN Code Gallery, it's called SQLExampels. In this WIKI presented information, represents the suggestions, ideas, and opinions of Volunteer Moderators and Answerers (you know Arnie Roland… more »

Orphan SQL-Server accounts

By using SP_MSForEachDB you can detect and display orphan SQL-Server accounts from all the databases of your SQL-Server.EXEC SP_MSForEachDB 'USE [?]; -- SYSTEM DATABASE ARE EXCLUDED IF DB_ID(''?'') > 4 SELECT ''?'' as DBName, name… more »
1 2 »