Day 2 of Common Table Expression Month (June) at SteveStedman.com, today I will cover creating your very first CTE. Keep in mind that this may look a bit weird or strange at first, the syntax is different from anything you may have seen with SQL Server before, and there are some parts that are very similar. First lets take a …

Writing Your First Common Table Expression with SQL Server Read more »

This is my 250th blog post at Steve Stedman.com.  Many of the post over the last year have been focused on Common Table Expression topics as I finished my CTE Book, however with last month being DBCC Command Month here there were many posts completely unrelated to CTEs. Another category that accounts for many of the posts is the Database …

250th Blog Post at SteveStedman.com Read more »

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 »