Viewing 15 posts - 676 through 690 (of 8,416 total)
If you omit the rownum column from the result, the query plan can use the ANY aggregate:
SELECT
X.Item,
X.OrderNo,
X.OrderLine,
...
May 5, 2012 at 8:15 pm
Lynn Pettis (5/5/2012)
Jeff Moden (5/5/2012)
SQL Kiwi (5/4/2012)
One way to do this is to materialize the CTEI'm definitely a fan of that especially when a CTE is referenced more than once.
I...
May 5, 2012 at 7:54 pm
The explanation could be better. The question does not involve a float value. By default, the literal value 0.25 is interpreted as a numeric(2,2):
SELECT
0.25...
May 5, 2012 at 7:40 pm
Jeff Moden (5/4/2012)
To continue, both queries use a "Work Table". The one with the MERGE hint uses it a whole lot less, though.
Sure. The work table in the...
May 4, 2012 at 11:09 pm
Jeff Moden (5/4/2012)
May 4, 2012 at 10:51 pm
Jeff Moden (5/4/2012)
May 4, 2012 at 8:08 pm
This is one type of problem where it is perhaps easier to see the logic using SQL Server 2012 syntax:
DECLARE @MyTable AS TABLE
(
idLigne ...
May 4, 2012 at 7:15 pm
How about:
SELECT COUNT(*)
FROM
(
SELECT ProductID, Location, SUM(cases) as TotalCases
FROM dbo.TblProduct
GROUP BY ProductID, Locations
HAVING (SUM(cases) <> 0)
) AS Query;
May 4, 2012 at 8:01 am
drew.allen (5/3/2012)
GSquared (5/3/2012)
MS documentation makes it very clear exactly what's being deprecated, which is the use of *= and =* in the Where clause for an outer join.
If it's so...
May 4, 2012 at 2:00 am
mtassin (5/3/2012)
Hugo Kornelis (5/3/2012)
May 4, 2012 at 12:34 am
opc.three (5/3/2012)
May 3, 2012 at 10:39 am
Lynn Pettis (5/3/2012)
SQL Kiwi (5/3/2012)
One possible test is to imagine one's mother reading the post before hitting 'reply' and wondering if it would make her proud.
Not trying to make my...
May 3, 2012 at 10:25 am
One possible test is to imagine one's mother reading the post before hitting 'reply' and wondering if it would make her proud.
I'm not sure The Thread actually has any special...
May 3, 2012 at 9:46 am
Shelly,
The 1 row estimate, 250052 actual occurs on the Key Lookup. This is how SQL Server looks up columns in the base table needed for the query that are...
May 2, 2012 at 3:51 pm
GSquared (5/2/2012)
May 2, 2012 at 12:05 pm
Viewing 15 posts - 676 through 690 (of 8,416 total)