Recent Blogs and Articles

Welcome to SQL Matters

SQL Matters is a resource for SQL Server Developers, Architects, DBAs and others interested in SQL Server and related technologies . Our site contains a wide range of articles, tips, blogs, quiz questions and other information about the SQL Server range of products. This includes Integration Services (SSIS), Reporting Services (SSRS), Analysis Services (SSAS) and some other products that we feel might be of interest to the SQL Server community such as PowerPivot and Report Builder.

Here are some examples of technical information that you might be interested in :

Featured Tip

Listing all tables in a database and their row counts and sizes

To get the number of rows in a single table we usually use SELECT COUNT(*) or SELECT COUNT_BIG(*). This is quite straightforward for a single table, but quickly gets tedious if there are a lot of tables, and also can be slow. Here are a few ways of listing all the tables that exist in a database together with the number of rows they contain.

Featured Script

Checking for unused indexes

SQL Server provides a lot of information in the Data Management Views (DMVs). This script shows how to identify indexes which are never actually used, by using DMVs such as dm_db_index_usage_stats and dm_db_index_operational_stats.

Quick Quiz : DATALENGTH results

What is the result of the following SQL query ?
DECLARE @MyStr NVARCHAR (100)
SET @MyStr = 'ABC'
SELECT DATALENGTH(@MyStr)
Choose one : a) 3    b) 6    c) 50    d) 100