Ever worked on a quick little project, come across what you assume is a common need and think “I’ll just google up some code that someone else has written and then be off to the races”? Have you done this and not been able to find the code you’re looking for? Well, that was me […]
I wish I could say this was my idea. Somebody posted it on twitter awhile back and I did the classic “facepalm”. I have no idea how many times I manually picked apart the results of SQL Server’s SET STATISTICS IO ON without considering creating a formula to handle it for me. So, somebody came […]
Preparing to do some MDX performance testing? Step one for each and every test should be to clear the cache. This will ensure you are seeing the performance results without the benefit of having data already loaded up in memory. How do you empty the MS SQL Analysis Services cache prior to running your query?
Whenever I want to check a setting in SQL Server I always prefer to find it using a query. Every once in awhile these settings turn out to be on the verge of being undocumented. This is the case with table level lock escalation (also known as partition level lock escalation). The T-SQL query below […]
Need to find the default schema for a user in MS SQL? Need to confirm all your SQL Server users default schema’s are set correctly? Easy peasey. Run the following query and enjoy.
Need a way to find all tables without a clustered index in SQL Server? Running this script every once in awhile will help ensure best practices are being followed and every table has a clustered index. This script is compatible with SQL Server 2005 and SQL Server 2008.
Want to rebuild all the indexes in your MS SQL database? The script below will rebuild all the indexes in your SQL Server 2008 or SQL Server 2005 (SP2) database and offers a number of enhancements that make this the best SQL Server index rebuild script in all the land and the first choice of […]
What’s the fastest way to get the number of rows in a table on SQL Server 2005 or SQL Server 2008? Use the code the pros use.