SQL SERVER – Stored Procedure are Compiled on First Run – SP taking Longer to Run First Time

During the PASS summit, one of the attendees asked me the following question. Why the Stored Procedure takes long time to run for first time? The reason for the same is because Stored Procedures are compiled when it runs first time. When I answered the same, he replied that Stored…
Read More

SQL SERVER – Plan Caching and Schema Change – An Interesting Observation

Last week, I had published details regarding SQL SERVER – Plan Caching in SQL Server 2008 by Greg Low on this blog. Similar to any other white paper, I have read this paper very carefully and enjoyed reading it. One particular topic in the white paper that caught my attention…
Read More

SQL SERVER – List All the Tables for All Databases Using System Tables

Today we will go over very simple script which will list all the tables for all the database. sp_msforeachdb 'select "?" AS db, * from [?].sys.tables' Update: Based on comments received below I have updated this article. Thank you to all the readers. This is good example where something small like this have good participation from…
Read More