As I have presented my Common Table Expressions presentation many times, and as part of writing the Common Table Expressions Book I have created some sample database scripts to use. Once you load up the script into SSMS and refresh the databases tree item, you will see a new database called cte_demo that includes 2 tables. dbo.Departments The first table is called …

Sample Database for Common Table Expressions Read more »

This month is going to be Common Table Expressions Month at SteveStedman.com.   My goal is to post one valuable post on a Common Table Expressions topic each day for the entire month. What is a Common Table Expression A Common Table Expression (know as CTE) is a type of in memory result set, similar to a view or a …

Common Table Expression (CTE) Month at SteveStedman.com Read more »

As the month of May comes to an end so does DBCC command month at SteveStedman.com. I didn’t cover all the DBCC Commands this month, but here is what I did have time to cover: May 1st – DBCC CheckAlloc May 2nd – DBCC CheckCatalog May 3rd – DBCC CheckConstraints May 4th – DBCC CheckDB May 5th – DBCC CheckFilegroup May 6th – DBCC CheckIdent May …

End of DBCC Command Month Read more »

Being day 27 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC SQLPERF. Description: DBCC SQLPERF is used to do a couple different things. Show a list of all the wait stats on your SQL Server. Show a list of the transaction log and the space used in the transaction log. Clear the wait stats. Clear …

DBCC SqlPerf Read more »

Being day 25 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC SHRINKFILE. Description: DBCC SHRINKFILE is used to shrink an individual log in SQL Server. DBCC SHRINKFILE Syntax: Example: The following example DBCC ShrinkFile is used to shrink a log file that grew too large. Related Posts: Blog Post Shrinking a Log File. Notes: For …

DBCC ShrinkFile Read more »

Being day 24 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC SHRINKDATABASE. When I first heard about DBCC Shrink Database (many years ago), I immediately thought “what a great feature, run this every night when the system load is low, and the database will be smaller, perform better, and all around be in better shape”. …

DBCC ShrinkDatabase Read more »

Being day 22 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC OUTPUTBUFFER. I missed a few days on the DBCC Commands due to attending SQL Saturday in Redmond, and the release of my book on Amazon.com.  I am now back on track to finish out the rest of the month with more DBCC commands. Description: …

DBCC OutputBuffer Read more »

I used to be able to do the Common Table Expression in a single 1 hour session, but after writing the book on Common Table Expressions, I discovered that I just can’t fit it into an hour with the detail that Common Table Expressions deserve. I would rather go into depth so that everyone can master CTEs rather than just breezing …

Common Table Expressions Presentations Updated. Read more »

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 »