Default Values and Computed Columns In SQL Server 2008, I was presented with the following error when attempting to create a table that has a default value that references other columns in the same table. Msg 128, Level 15, State 1, Line 6 The name “Subtotal” is not permitted in this context. Valid expressions are constants,  constant expressions, and (in …

MSG 128, Level 15, State 1 – not permitted in this context Read more »

Just the same query that I posted months ago, but this time it is wrapped in a stored proc.  I use this one often enough that it is easier to just call the stored proc. Download the FindOneTimeUseQueries source code. TSQL example: CREATE PROCEDURE [dbo].[Findonetimeusequeries] AS BEGIN SET nocount ON; SELECT TOP 100 refcounts, usecounts, size_in_bytes /1024 AS sizeinkb, TEXT FROM sys.dm_exec_cached_plans CROSS APPLY sys.Dm_exec_sql_text(plan_handle) WHERE cacheobjtype = ‘Compiled Plan’ AND objtype = ‘Adhoc’ AND usecounts = 1 AND TEXT NOT LIKE ‘FETCH API_CURSOR%’ ORDER BY size_in_bytes DESC END     This posting …

Big One Time Use Queries – Revisited Read more »

Attached is the slide deck for a short presentation on indexing that was created to educate software developers on the basics of indexing. Outline: What is an Index Types of Indexes Non Clustered Indexes Clustered Indexes When To Avoid A Clustered Index Covered Indexes Index Usage Terminology Summary Additional Topics Download Indexing_Overview.pdf Here is the text outline of the presentation.   …

Indexing Presentation – The Basics Read more »

Here are the slide decks from the Introduction to SQL Server class – January 2010. Class 1 About the Instructor Introduction and Class Overview (Review Syllabus) Course Logistics – What to expect and what is expected What is SQL Server? Installing SQL Server 2008 SQL Server Management Studio Differences between SQL Server 2005 and SQL 2008 Introduction to SQL Books …

Notes from the Introduction to SQL server class. Read more »

The current datacenter has failed.  The company that we have been using Fibercloud in Bellinhgam WA, with their “Always On” slogan has had an epic failure. Server temp of 117 degrees F means that it is time to move to a real datacenter. Planning on configuring a new SQL server a the new location, then doing a full restore and …

Moving to a new datacenter – EPIC FAIL – Fibercloud. Read more »