Viewing 15 posts - 1 through 15 (of 507 total)
Orlando,
There is another situation where even if recursive triggers is turned off in the database, you can still get recursion from what I call cross-firing triggers. That is when...
May 3, 2012 at 12:18 pm
Rudolf,
Gail Shaw wrote and excellent series of articles covering IN vs. Exists, NOT EXISTS vs. LEFT JOIN.
You should take a look:
http://sqlinthewild.co.za/index.php/2010/03/23/left-outer-join-vs-not-exists/
Todd Fifield
April 5, 2012 at 4:30 pm
sclements,
Any time you join from a parent table to a child table that has multiple rows per parent, you get the child number of rows in the query. That's...
March 27, 2012 at 12:45 pm
Antonio,
Here is a solution that is a bit easier to read than Cadavre's solution. It doesn't perform quite as well on large record sets, however.
It's just another option.
CREATE TABLE...
March 23, 2012 at 11:40 am
Emmet,
You need to post the DDL for the tables involved and some sample data for the tables. Also we don't have an idea as to what the variables are...
March 22, 2012 at 6:41 pm
As Rich said before, you want to use a time based table as the anchor and left join to the real data.
Here's an article with an example of using a...
March 21, 2012 at 2:01 pm
Gerald,
If you want something like comparing the current year to the same period in the prior year, setting up a proper calendar table would immensely help out with the heavy...
March 21, 2012 at 1:49 pm
Ken,
You're on the right path if you select from the OPENQUERY into a temp table and use that from there on out. I found out long ago that doing...
March 21, 2012 at 1:44 pm
CXPACKET waits are usually more related to IO than anything else from my experience - a thread is waiting for IO to complete.
I find it hard to believe...
March 20, 2012 at 2:39 pm
I recall seeing 2 instances of this. The clients went from 2000 to 2005 and a few queries performed poorly. Full index rebuilds were done in both cases...
March 13, 2012 at 4:09 pm
Vijay,
For this type of complicated WHERE clause containing many OR type conditions, I've found I can usually get better performance by doing several queries with a UNION. If the...
February 10, 2012 at 11:44 am
Rafi,
The first thing I noticed about the execution plan was a clustered index scan (same as a table scan) on the tfsReceipt table. If you have an index on...
January 23, 2012 at 11:50 am
mgchris (1/20/2012)
January 21, 2012 at 12:41 pm
Actually the test IF UPDATE(ColA) will always test true for an INSERT (if the trigger happens to be for both UPDATE and INSERT) and will always test true if ColA...
January 20, 2012 at 12:52 pm
My 2 cents on query designers. I'm not a huge fan of them for SQL Server. They are about the only place I've ever seen a RIGHT JOIN...
January 18, 2012 at 11:32 am
Viewing 15 posts - 1 through 15 (of 507 total)