Forum Replies Created

Viewing 15 posts - 1 through 15 (of 56 total)

  • RE: SQL Server Migration from 2012 to 2014 is degrading the query performance

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: Filter based on the count of value

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: Filter based on the count of value

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: Filter based on the count of value

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: How to quickly update an xml column in a table to NULL

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: what is wrong with this query?

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: Help avoiding temp table with string of IDs passed into stored procedure

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: Parameter Sniffing

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: need to find duplicate rows like same entries more than one time

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: how to find unique rows condiering only specific columns

    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

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: Find the Numbers from a string

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: Find the Numbers from a string

    DECLARE @s 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));

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: Find sequential numbers

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: WITH RECOMPILE on Web Server - discussion

    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...

    ___________________________
    Do Not Optimize for Exceptions!

  • RE: Execution Plan

    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...

    ___________________________
    Do Not Optimize for Exceptions!

Viewing 15 posts - 1 through 15 (of 56 total)