Forum Replies Created

Viewing 15 posts - 1,006 through 1,020 (of 5,841 total)

  • RE: Query calculation over a partition

    Eirikur Eiriksson (5/28/2016)


    santiagoc93 (5/27/2016)


    select customerId, window, product, sales,

    ( Case when count(sales) over(partition by customerid order by customerid) >0 then 1 else 0 end)as class

    from #example

    Very nice!

    😎

    The addition...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: SQL back Job is failing

    There is a good bit to a SQL Agent job's execution from a security standpoint, especially a backup one, which needs access to external resources such as a directory to...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Improving performance of a query.

    Look up Index View in Books Online.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Dynamically Query a 100 Million Row Table-Efficiently

    Alan.B (5/27/2016)


    TheSQLGuru (5/27/2016)


    ChrisM@Work (2/24/2015)


    ... Two omissions stood out however - the cost of recompiling, ...

    I will jump through hoops to trade CPU ticks to avoid disastrously bad plans (and the...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Dynamically Query a 100 Million Row Table-Efficiently

    David.Poole (5/27/2016)


    Some time ago I saw an article where the author had noticed a problem with a query where the principle condition was WHERE OrderDate BETWEEN @StartDate AND @EndDate.

    The problem...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Dynamically Query a 100 Million Row Table-Efficiently

    ChrisM@Work (2/24/2015)


    ... Two omissions stood out however - the cost of recompiling, ...

    I will jump through hoops to trade CPU ticks to avoid disastrously bad plans (and the horrible IO...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Query pagination around multiple select

    I don't have time to wade through all that code right now, but are you actually using the OFFSET clause?? Look it up in Books Online if not.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Query calculation over a partition

    SIGN is one of the things used in the '60s to develop characteristic functions (the precursor to the modern CASE statement), which allowed incredibly powerful data processing in a single...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Help with performance on query

    beaudamore (5/27/2016)


    So, thanks to Michael L John and TheSQLGuru for actual helpful pertinent information that followed my question.

    I have followed your pattern somewhat and gone with CTEs to gather the...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Query calculation over a partition

    This could be quite a bit more efficient. That COUNT gets especially expensive as the number of matching rows goes up.

    SELECT *,

    CASE...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Need help identifying dates of an occurance after a specific date

    Thanks for the setup stuff. But in the future please make sure it works. 😀

    Note I don't think this code will work correctly if a driver has more than 2...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Improving report performance by yearly data segregation

    A) If the report queries are finishing so quickly then NOTHING you do to "make them go faster" will help, right? That 7 minutes OUTSIDE SQL Server has to be...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Improving report performance by yearly data segregation

    Brandie Tarvin (5/26/2016)


    I need a little help to be pointed in the correct direction. We have a report that has been doing poorly since our upgrade from SQL 2008 to...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Query not executing dynamic way

    I MUCH prefer to do my dynamic SQL this way. Now I don't have to worry about if it is 1, 2, 3, N stupid single quotes to make the...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • RE: Poor SQL Performance

    So about 400ms IO waits per 1 second clock time. I call that not good. If your perf is acceptable then maybe you can work on other things.

    Have you tuned...

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

Viewing 15 posts - 1,006 through 1,020 (of 5,841 total)