Forum Replies Created

Viewing 15 posts - 61 through 75 (of 149 total)

  • RE: GROUP BY in SQL Server 2014

    Sergiy (12/21/2016)


    That could be said about the vast majority of those "good advises" you referring to.

    Advise does not necessarily equal a solution.

    Ready-made solutions which an OP can use but not...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Windowing function with conditions?

    I can't see the image.

    Please also provide more sample data.

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Windowing function with conditions?

    olibbhq (12/22/2016)


    Hi,

    What I would like to do is to return a running maximum and a running minimum

    but with the added complexity that (sorting by rank ID) if the lower...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Day-On-Day / Month-On-Month Queries for Temporal Tables

    Sonny Childs (12/21/2016)


    Would love to get some feedback on this, because it feels like I've just used a rocket launcher to smite a mosquito.

    Tally table provides the power of a...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Day-On-Day / Month-On-Month Queries for Temporal Tables

    Use a number/tally/calendar table to iterate through the days.

    http://www.sqlservercentral.com/articles/T-SQL/62867/

    On a separate note, UNION eliminates duplicate rows, but your result sets are guaranteed unique (different dates). You are adding unnecessary...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: GROUP BY in SQL Server 2014

    CELKO (12/19/2016)


    The best teachers I ever had were the ones that humiliated me when I was blindly stupid and could not get the basic concepts.

    Here you just scare people away....

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Query help filling in dates and data

    DK13 (12/20/2016)


    NULL is a valid action type.

    I'll save Celko the effort here. NULL is not a valid action type. It is messing up your results because you are...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Calling a Insert/Update Stored Procedure from a Result set of Query

    Use of Merge seems a good match for what you are asking.

    However, I am baffled by what you are trying to accomplish with this. I can't think of any...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: When Your Primary Key is Not the Clustered Index

    m.sams (12/19/2016)


    What do I lose by exchanging the Primary Key index with another non-clustered index?

    Don't think of the non-clustered PK as an index. It is just a constraint which...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Long running insert

    In addition to Kevin's comments, you also have potential for unexpected results.

    SELECT CAST(RTRIM( b.description ) AS FLOAT) AS ohproc,

    ...

    Group by b.description

    However many spaces you're trimming are still included when grouping....

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Select query inside procedure taking long time, clustered indexes doing scans, need suggestion

    This distinct is not necessary and has not effect on the result. It probably won't affect the query time as the optimizer is likely ignoring it, but better to...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Data file growth events and clustered index

    Just another thought.

    If you're needing space to convert the heap to a clustered index, drop any non-clustered indexes on the table first. NCIs also take up space and they'll...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Data file growth events and clustered index

    SQL Learner - VKG (12/14/2016)


    changing any heap into clustered index requires about same amount of space as that of table until that operations is completed. ... Conclusion : Clustered Index...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Data file growth events and clustered index

    Igor Micev (12/12/2016)


    If you have databases in Simple recovery model then check their Log files and potentially shrink them. But shrink the log files only, don't do that with the...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Recursive cte in infinite loop

    bucketlist50 (12/9/2016)


    Declare @Counter int = 1;

    with cte as (

    SELECT @Counter as c,ASSET_NUM,[SHAPE].STPointN(@Counter).STAsText() as Points

    FROM [dbo].[GEOMETRY_TABLE]

    where ASSET_NUM =...

    Wes
    (A solid design is always preferable to a creative workaround)

Viewing 15 posts - 61 through 75 (of 149 total)