Viewing 15 posts - 1 through 15 (of 55 total)
Can you post the query and both plans with estimations? As Grant said, on of the first things you have to check in such cases is new Cardinality Estimator. It...
March 17, 2015 at 1:03 pm
The best resource for window function is the Itzik's book Microsoft SQL Server 2012 High-Performance T-SQL Using Window Functions
Here is a great article series (3 articles) written by Fabiano...
March 10, 2015 at 7:18 am
If you define the column with the DATETIME data type you save (as the name says) date and time component of a date together so you can have any number...
March 10, 2015 at 6:43 am
Hi,
First I would suggest you to use appropriate data types for attributes. If you use DATETIME datatype for the attribut Rent_Review_Date you don't need anymore two attributes for review_date which...
March 10, 2015 at 5:06 am
If this column should have NULL in all rows you can create a new nullable column with the name XmlColumn2 and then swap the names between XmlColumn and XmlColumn2 columns...
March 10, 2015 at 3:38 am
Just on the first look I noticed that you have
MONTH(CreatedOn) =MONTH(GETUTCDATE())
which will return all rows created in March in any year, not only in 2015 as you wanted (according to...
March 10, 2015 at 3:18 am
As far I understood the plan you get with table variable is the most efficient one. Usually you get the best plan when you use literals in queries, without variables...
October 1, 2014 at 3:02 pm
Hi Louis,
Try to replace the orginial WHERE clause (without local variables) with the following code:
WHERE (QU.QuotationDate > @From OR COALESCE(QUIC.Next_Follow_Up, 0) > 0 )
AND QU.QuotationDate...
September 17, 2014 at 1:48 am
If we define duplicate rows as rows where the following attributes are equal: attendace_date, staff_id, working_year, [hours] and that the original row within them is the row with the smallest...
September 17, 2014 at 1:37 am
WITH cte AS
(
SELECT
Id,[Status],manager,Team,Comments,[Proj number],[Date],
ROW_NUMBER() OVER(PARTITION BY [Status],manager,Team,Comments,[Date] ORDER BY Id ASC) rn
FROM YourTable
)
SELECT Id,[Status],manager,Team,Comments,[Proj number],[Date]
FROM cte
WHERE rn = 1
ORDER BY [Date] ASC
April 18, 2014 at 1:45 am
BWFC (4/8/2014)
That solution works but will give an error if the string consists of only numerals.
Thank you BWFC for the correction!
A great thing in this forum is whenever you...
April 8, 2014 at 6:19 am
DECLARE @s-2 AS VARCHAR(100)='123756zxfggr123456';
SELECT REVERSE(
SUBSTRING(REVERSE(@s),PATINDEX('%[0-9]%',
REVERSE(@s)),PATINDEX('%[^0-9]%',
SUBSTRING(REVERSE(@s),(PATINDEX('%[0-9]%', REVERSE(@s))),LEN(@s)))-1));
April 8, 2014 at 4:51 am
To solve this problem you can use an excellent article (actually series of articles) by Itzik Ben Gan about gaps and islands. Since you are using SQL 2000 you could...
April 5, 2014 at 5:09 am
GilaMonster (4/4/2014)
I think, as for almost all hints and options, it's a targeted solution to specific problems, not something to be put on every procedure blindly.
+1
Only if you are sure...
April 4, 2014 at 3:42 am
It is true that Key Lookup can be avoided by converting your index to covering index. But, you should be careful! If you include too much columns you will actually...
April 4, 2014 at 3:19 am
Viewing 15 posts - 1 through 15 (of 55 total)