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 17 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC INPUTBUFFER. Description: DBCC INPUTBUFFER allows access to the last query run for a specific session (SPID). DBCC INPUTBUFFER Syntax: Example: The following example we get a list of the sessions, then browse the queries that they have been running. Next if we use one …

DBCC InputBuffer Read more »

Being day 16 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC INDEXDEFRAG. Description: DBCC INDEXDEFRAG was used for to defragment indexes on SQL Server 2000, the same thing can be done with Alter Index on newer versions of SQL Server.. DBCC INDEXDEFRAG Syntax: For more info on index defragmentation, check out the Database Health Reports …

DBCC IndexDefrag Read more »

Being day 15 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC HELP. Description: DBCC HELP is used get more information about a specific DBCC Command. DBCC HELP Syntax: Example: The following example calls DBCC Help to get help on the help command. You can use DBCC Help on any of the DBCC Commands here DBCC …

DBCC Help Read more »

Being day 14 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC FREESYSTEMCACHE. Description: DBCC FREESYSTEMCACHE is used to free all memory associated with all of the SQL Server caches. DBCC FREESYSTEMCACHE Syntax: Example: The following example we first select form sys.dm_os_memory_clerks to find all of the available system caches that could be freed. In order …

DBCC FreeSystemCache Read more »

Being day 13 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC FREESESSIONCACHE. Description: DBCC FreeSessionCache is only available on SQL Server 2005 and newer it removes all queries from the distributed query cache. This however does not impact anything in the standard procedure cache, to clear the standard procedure cache use DBCC FreeProcCache instead. The distributed …

DBCC FreeSessionCache Read more »

Being day 12 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC FREEPROCCACHE. Description: DBCC FREEPROCCACHE is used for purge all of the parsed query plans out of memory. This is commonly used in development environments, but not as common in a production environment. Use in a development environment is common, for instance when you are …

DBCC FreeProcCache Read more »

Being day ten of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC DROPCLEANBUFFERS. Description: DBCC DropCleanBuffers is great to use in a development or test environment to flush all of the clean data pages out of memory to use for performance testing purposes.  This can be combined with DBCC FreeProcCache to simulate the state of a freshly …

DBCC DropCleanBuffers Read more »