Monthly Archives: July 2010

SQL Server 2008 Query Performance Tuning Distilled

This is the best book I ever read in query performance tuning. Grant Fritchey in this book show the simple ways to optimize queries.For more information refer to: http://apress.com/book/view/9781430219026

Posted in T-SQL Tips & Tricks | Leave a comment

SQL Server 2005 says : ‘Cannot connect to WMI provider’

I saw the message bellow few months ago: Cannot connect to WMI provider.You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 servers with SQL Server Configuration Manager. The best solution … Continue reading

Posted in Database Administration, T-SQL Tips & Tricks | Leave a comment

SQL SERVER counter via query

I suggest that at least once  see the sys.dm_os_performance_counters view. For an example execute this simple query:

Posted in Database Administration, T-SQL Tips & Tricks | Leave a comment

Count(*) vs Count(1) vs Count(column)

because 1 is an expression, there is no difference between Count(*) and Count(1). But Count(column) is completely different from Count(*). The reason is Count(column) ignore NULL but Count(*) means Count all rows NULL or NOT NULL. Tip: All aggregate functions ignore … Continue reading

Posted in Joy of T-SQL, T-SQL Tips & Tricks | 1 Comment

Saving changes is not permitted

In SQL SERVER 2008 probably face with such this error: Saving changes is not permitted. The changes you have made require the following table to be dropped and re-created. You have either made changes to a table that can’t be … Continue reading

Posted in Database Administration, T-SQL Tips & Tricks | Leave a comment

Cannot drop database because it is currently in use.

Somtimes we see this error when wanna drop a database: Cannot drop database “testdb” because it is currently in use. It is strongly recommended that when we want to drop a database use master databse: USE master; DROP DATABASE testdb;

Posted in Joy of T-SQL, T-SQL Tips & Tricks | Leave a comment

Microsoft SQL Server 2008: T-SQL Fundamentals

Today I want to introduce a book that is very useful. I wanna say about: Microsoft SQL Server 2008: T-SQL Fundamentals This masterpiece from Itzik Ben-Gan published by MSPress. This book is a way of thinking in T-SQL programming. Itzik simply says about … Continue reading

Posted in T-SQL Tips & Tricks | Leave a comment

How to identify duplicate records in sql server

Very common issue is duplicated records that prevent creating index on table. We can use this simple query for identify them:

Posted in Joy of T-SQL, T-SQL Tips & Tricks | Leave a comment

sql 2005 Setup failed to obtain sys acc info for the ASPNET acc

During installing SQL SERVER 2005 process, if setup failed and error message is like below: SQL Server Setup failed to obtain system account information for the ASPNET account.To proceed, reinstall the .NET Framework, and then run SQL Server Setup again. … Continue reading

Posted in Database Administration, T-SQL Tips & Tricks | Leave a comment