My common Table Expressions book became available on Amazon.com late last week. After presenting on Common Table Expressions at SQL Saturday yesterday, the sales jumped a bit to the point that the CTE Book is now #2 in the Hot New releases for Computer Databases section at Amazon.com as shown in the image below. This is so exciting after all …

Common Table Expressions Book Excitement Read more »

It was a great day at SQL Saturday today. I was able to preview my Common Table Expressions Book at my Common Table Expressions presentation.  The presentation was great, the room was packed, and there were lots of great questions. Here is the lineup for the room that I presented in.  Just before me was Rick Morelan presenting on SQL …

A Great Day At SQL Saturday Redmond Read more »

I will be presenting at SQL Saturday #212 in Redmond tomorrow. My presentation will be on Common Table Expressions, and it is the first CTE presentation since my Common Table Expressions book released.  I have updated the presentation to include a number of new things relating to CTE’s that I figured out while writing the book. This will be my …

Presenting at SQL Saturday #212 in Redmond Tomorrow Read more »

Being day four of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC CHECKDB. For more info on DBCC see the Database Corruption Challenge. DBCC CheckDB Description: DBCC CHECKDB is used to check the physical integrity of the entire database. DBCC CHECKDB is used to detect corruption in the database, and should be run regularly.  This is …

DBCC CheckDB for Database Consistency Read more »

Being day three of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC CHECKCONSTRAINTS. Description: DBCC CHECKCONSTRAINTS is used to check the integrity of one constraint, all constraints for a table, or all constraints for a database. DBCC CHECKCONSTRAINTS Syntax: Example: To check constraints for an a single table: For instance to check the constraints on the …

DBCC CheckConstraints Read more »

Being day one of DBBC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC CHECKALLOC. Description: DBCC CheckAlloc checks and can repair disk space allocation structures for a database. DBCC CheckAlloc checks the allocation for all pages in the database compared to their internal structures representing those pages. When you run DBCC CheckDB it internally runs the equivalent of DBCC …

DBCC CheckAlloc Read more »

For more information on cursors, also take a look at the free SQL query training provided by Steve Stedman. Cursors are a feature of SQL Server that allow users to iterate through a result set one row at a time. This can be useful in situations where a user needs to perform a set of operations on each row of a …

T-SQL: A Simple Example Using a Cursor Read more »

In my Common Table Expressions presentation the topic of recursion often comes up, but for scalar functions in T-SQL, it might not be as common. This article has been written to show how a scalar function in SQL Server can call itself, thus being considered recursive. The example uses a recursive scalar function to calculate the Fibonacci sequence. What is …

Recursive Scalar Function in T-SQL Read more »

My Common Table Expression presentation was accepted for SQL Saturday 212 in Redmond WA. This is the session that I am the most familiar with, and that I have presented the most times. I think this will be the 8th time I have presented this session, and after every previous presentation it has been improved. Over the last several months …

Common Table Expression accepted for SQL Saturday 212 in Redmond WA Read more »

SQL Server 2012 adds a new function called DateFromParts.  This new function simplifies the creating of a DATE type in TSQL over the older ways of doing it. The information here has been extracted from my SQL Saturday presentation on Whats New in TSQL 2012. Pre-SQL 2012 First lets take a look at how you would do the equivalent to DateFromParts before SQL …

DATEFROMPARTS function in TSQL Read more »