SQL Server check table fragmentation level


If you are using SQL Server, and discover that what should be a simple select query, or particularly multiple select queries that are unioned together with a sort are running slowly, then the issue is your table indexes. This is particularly the case when using Date and DateTime fields for sorting. If you are trying to sort a table or multiple tables by Date, then it is a good idea to add an...

SQL Server – Increasing query performance for large reports


Its always a balance when creating reports, you want to produce an amazing report, but you dont want to cripple your server and make it unresponsive for other users whilst it is produced. After a lot of research, we found that adding: SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; as the first line in a stored procedure greatly improves performance for other users as the stored procedure then...

SQL Server Distinct – Make it Case Sensitive


By default SQL Server DISTINCT is NOT case sensitive. This means that if you had the following data in a table: FirstNames Richard Adam James Adam Ryan RICHARD Richard and queried this table with “SELECT DISTINCT FirstNames FROM table” you would get: FirstNames Richard Adam James Ryan However, there are occasions where you want the case taken into account. Change the query to include...



Get in touch

I'm available on just about every social media platform out there as RMTWeb.