Tag Archives: Common SQL Server Mistakes

Common SQL Server Mistakes – Functions in the WHERE Clause

This continues my series on Common SQL Server mistakes, looking at more T-SQL mistakes. What’s Wrong? If you saw a query like this, would you see a problem? select   o.OrderID   , o.CustomerID   , o.Qty from Orders o where datepart( yyyy, … Continue reading

Posted in Blog | Tagged , , , , | Comments Off on Common SQL Server Mistakes – Functions in the WHERE Clause

Common SQL Server – Not Indexing FKs

This series looks at Common SQL Server mistakes that I see many people making in SQL Server. Foreign Keys It’s way too often that I see people building databases without including declared referential integrity (DRI) in their databases. Even when … Continue reading

Posted in Blog | Tagged , , , , , | Comments Off on Common SQL Server – Not Indexing FKs

Common SQL Server Mistakes – Equals NULL

One thing that I don’t see a lot, but it still happens with people new to SQL Server is the comparisons they’ll make with NULL values. Often those people new to T-SQL will write this: select CustomerID, CustomerName from Customers … Continue reading

Posted in Blog | Tagged , , | Comments Off on Common SQL Server Mistakes – Equals NULL

Common SQL Server Mistakes – Indexing Every Column

If one index helps speed up queries, than more indexes should help more, right? They do, but they also come at a price. Both in performance during data modifications (insert/update/delete), and in terms of space since each index must be … Continue reading

Posted in Blog | Tagged , , , | Comments Off on Common SQL Server Mistakes – Indexing Every Column