Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » T-SQL Anti-patterns   (RSS)
Sorry, but there are no more tags available to filter with.
This is really not a T-SQL anti-pattern as much as it is a database design issue, but we see it so often that it’s worthwhile bringing it up and clarifying things. For illustrating the scenario, let’s examine the table Person.Contact in the AdventureWorks Read More...
Scenario A common requirement for enquiry queries on an OLTP database is to have search criteria which are very specific ('get me details for for OrderID = NNNN') and also the occasional reports which ask for all the orders ('get me all the orders, no Read More...
Scenario It is a pretty common situation to have transaction date-time stored in a DATETIME field. The problems start with the fact most applications used GETDATE() or some such equivalent at the client side to record the order date-time stamp. So a typical Read More...
This one is even more common and therefore has a high impact: the usage of the above functions in WHERE clause predicates. I've examined each in some detail below. Here's a typical example I see, based off the AdventureWorks database. Scenario To illustrate Read More...
In the course of my work as a SQL Server Premier Field Engineer, we tend to see a lot of patterns in code. Some of these patterns do not lend themselves to optimal performance. This post is the first in a series of such 'how not to code' tips which would Read More...
 
Page view tracker