|
|
|
|
Browse by Tags
All Tags » SQL Server (RSS)
-
Five years ago I published my first article about SQL Server, "Index Covering Boosts SQL Server Query Performance" It is still quite popular - I just googled up "index covering", and it comes right on top. Bing does the same thing. It was just mentioned Read More...
|
-
Working in mixed database environments is a very interesting challenge, both for DBAs and developers. If we already have experience with SQL Server, and need to work with Oracle, our SQL Server experience may be an advantage - we already have a good handle Read More...
|
-
Yesterday I delivered a session named "Develop T-SQL defensively" at East Iowa SQL Saturday. Thanks to those who attended, and many thanks to Michelle Ufford, Chris Leonard, Ed Leighton-Dick, and other volunteers, who organized the event. Here are the Read More...
|
-
Yesterday I delivered a session named "Developing T-SQL to survive concurrency" at East Iowa SQL Saturday. Thanks to everyone who attended, and thanks to Michelle Ufford, Chris Leonard, Ed Leighton-Dick, and other volunteers, who organized the event. Read More...
|
-
Recently I encountered a case when I knew much more about the data than the optimizer. Originally the performance was horrible, this is why I had to have a look at the query in the first place. When I was able to share my knowledge with the optimizer, Read More...
|
-
Sounds trivial? Right, but different flavors of this myth still persist. Yesterday I noticed a thread on stackoverflow discussing SELECT TOP without a where clause, where it was suggested that "The order will be defined based on the clustered key in that Read More...
|
-
Some T-SQL code is written under the assumption that either a TRY block successfully completes or a CATCH block is invoked. Most likely, this is the case. However, there is a third, although rare, possibility – the TRY block may fail, and the CATCH one Read More...
|
-
We can tuck any logical expressions in CHECK constraints, but all foreign keys are currently capable of right now is to verify that one or more column values are equal. In many cases it would be very useful to have foreign keys use more complex logical Read More...
|
-
Suppose that you need to enforce the following business rule: contracts cannot be changed after you have started working on them (let us assume that that particular business operates in the perfect world). You can use a ROWVERSION column, a persisted Read More...
|
-
When you process your rows one by one in a loop, you need to make sure that your loop never runs infinitely. I will describe three scenarios with possible infinite loops. There have been many articles discussing feasibility of loops vs. set-based solutions Read More...
|
-
Although there are many discussions about which kind of cursor or loop performs the best, there is no doubt which loops perform the worst – the infinite ones of course. Whenever you write a loop, you need to make sure that it never runs infinitely. I Read More...
|
-
Selects under READ COMMITTED may return incorrect results if the data they select is being modified at the same time. I will provide a repro script which on my laptop returns incorrect results in more than 90% cases. Also I will provide a similar repro Read More...
|
-
I have already described several deadlock scenarios that involve only one table in another post. This time I will describe an intermittent deadlock which occurs in high concurrency environments. Before providing a complex repro script for it, I will provide Read More...
|
-
I have written up two examples when a SET ROWCOUNT command breaks a seemingly working stored procedure or trigger. Note that currently the best practice is to use TOP clause instead of SET ROWCOUNT, which is deprecated in SQL Server 2008. However, even Read More...
|
-
Apparently for high isolation levels some heap tables may be more prone to deadlocks than identical tables with clustered indexes. I have a simple repro script which successfully completes if a table has a clustered index but embraces in a deadlock if Read More...
|
|
|
|
|
|