Forum Replies Created

Viewing 15 posts - 1,381 through 1,395 (of 10,144 total)

  • RE: Find "Consecutive" records based on available dates in another table

    jtrask (7/13/2016)


    Of course. It all seems obvious once someone spells it out for me.

    I like the idea of doing it on the fly. There's no point in having...

  • RE: Are the posted questions getting worse?

    SQLRNNR (7/13/2016)


    ChrisM@Work (6/29/2016)


    tindog (6/29/2016)


    ChrisM@Work (6/29/2016)


    tindog (6/29/2016)


    ChrisM@Work (6/29/2016)


    tindog (6/29/2016)


    Now Wales are after independence from England to 'safeguard' their future...despite the fact that they also voted in favour of Brexit :w00t:

    The Welsh...

  • RE: A problem of concurrency on a small table

    Is the UPDATE always followed by a SELECT of the new values?

    UPDATE [cpwarn] set [autonum] = [autonum]+@1

    WHERE [tablecode]=@2

    SELECT autonum, tablecode FROM cpwarn WITH (NOLOCK)

    WHERE tablecode='prog\DONUMREG\''001''\''2016 '''...

  • RE: A problem of concurrency on a small table

    paolobianchi (7/13/2016)


    voilà 🙂

    thank you

    Paolo

    Thanks - but these are estimated plans. If possible can you post up actual plans? An actual plan of the SELECT is straightforward, use the query from...

  • RE: aggregate function in subquery

    Pro100 (7/13/2016)


    Yea, i know what SQL tells me but I post it here cause i thought someone will help me rewrite it.

    Post the whole query.

  • RE: A problem of concurrency on a small table

    Capture actual execution plans for each operation against the table, and post them as .sqlplan file attachments.

  • RE: Subquery Question

    SQLPain (7/12/2016)


    I took out the distinct.

    If somebody else could also look into it that would be great

    This should be close:

    SELECT --DISTINCT

    x.[Facilitator],

    [Funded Apps] = SUM(CASE WHEN y.[Status] = 'Funded'...

  • RE: Subquery Question

    SQLPain (7/12/2016)


    I took out the distinct.

    If somebody else could also look into it that would be great

    Sure. There's a ton of redundant joins and stuff in it but something...

  • RE: Select and select into calulation produces Different result ??? HELP

    rmurray 17656 (7/13/2016)


    I have a Calculation in a query that is producing two different results. when used in a query statement the result is 160.442873, However when I use...

  • RE: Date Range overlaps

    J Livingston SQL (7/11/2016)


    ChrisM@Work (7/11/2016)


    Assuming you're in a playpen, CHECKPOINT then dbcc dropcleanbuffers. You might free up a few kb 😀

    I'll tell you what I'll do Chris......as its only a...

  • RE: Date Range overlaps

    Assuming you're in a playpen, CHECKPOINT then dbcc dropcleanbuffers. You might free up a few kb 😀

  • RE: Date Range overlaps

    Eliminated that pesky spill:

    == JLS1 ==========================================================================

    SQL Server parse and compile time:

    CPU time = 0 ms, elapsed time = 8 ms.

    Table 'testtable'. Scan count 34, logical reads...

  • RE: Date Range overlaps

    J Livingston SQL (7/11/2016)


    == CJM2 ==========================================================================

    Table 'testtable'. Scan count 9, logical reads 24440, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads...

  • RE: Date Range overlaps

    J Livingston SQL (7/11/2016)


    guess I am !!

    only 12 GB here

    Try with this index G, I'm getting about 10% improvement.

    -- CREATE UNIQUE NONCLUSTERED INDEX [idx_Code_Dates] ON [dbo].[testtable] ([Code] ASC,[enddate]...

  • RE: Date Range overlaps

    J Livingston SQL (7/11/2016)


    It's quick G but not quite as quick as this, which uses no Black Magic at all:

    I dont get the same results Chris....any thoughts ??

    PRINT '==...

Viewing 15 posts - 1,381 through 1,395 (of 10,144 total)