Forum Replies Created

Viewing 15 posts - 16 through 30 (of 98 total)

  • RE: Slow Row Number Over Partition

    No doubt of that.

    But like i said before, even if change the index and the logical reads decrease about 50%, the time is the same.

    And if i use the...

  • RE: Slow Row Number Over Partition

    Just for testing i tried your suggestion, but the time it's almost the same, so in this case, at least with this amount of rows the only difference that i...

  • RE: Slow Row Number Over Partition

    Found a solution/workaround

    If the complete query takes no time, just mix the two querys:

    SELECT pf ,

    Data ,

    Descr

    FROM dbo.PFAuxiliar PFA1 INNER JOIN (

    SELECT ROW_NUMBER() OVER (PARTITION BY pf ORDER BY...

  • RE: Slow Row Number Over Partition

    @Gazareth

    Yes it's MAX, this is a aux table with some comments to every pf at another table.

    At this point i need to return every row, it's kind of...

  • RE: Drop SP TemDB

    Thanks for all the replies.

    I solved the problem in the SSMS GUI, Activity Monitor, Processes tab, filter the TempDB, and then selected the process and Kill 🙂

    THanks

  • RE: Drop SP TemDB

    Thanks for the quick reply.

    How can i do that?

    Just to put the things in perspective i have my login, the same login that created the sp in the production...

  • RE: SQL Kind of Pivot

    Me and the PIVOT function... :doze:

    Thanks works great.

  • RE: Trying to replace cursor

    @JeeTree

    Thanks for the info and for the links.

    @sean Lange

    The output in the sample it's the content of the @Third table.

    I'll try to put the problem in another perspective.

    Assuming...

  • RE: Trying to replace cursor

    To literal...

    When i say next row, i mean all the rows, not necessary the next id...

    In this case, i have 5 + 10 + 100 = 115, and i have...

  • RE: Latest date when date doesnt exist

    Oh... Bad habits, someone helping, then we forget to think...:ermm:

    Reversing the order, its obvious that if the date exists it will find it before the Row Num. 😀

    Thanks

  • RE: Latest date when date doesnt exist

    Thanks

    But it doesn't work, the final result of that query is:

    Grp 1 - 2014/09/14 - Comment 3

    Grp 2 - 2014/09/19 - Comment 5 / Should be - 2014/09/14 -...

  • RE: Duplicate Rows Withe Percentage

    Nice tip, I'll have that in mind in the future.

    Normally my approach it's building a working solution, like the cursor version heavy/slow, and then working my way out to optimizing...

  • RE: Duplicate Rows Withe Percentage

    Hehehe, i just forgot to save the @Percentage value for each row, or at least when the first insert statement doesnt run... But nice to pointing that out. 🙂

    Thanks for...

  • RE: Duplicate Rows Withe Percentage

    Hehehe

    The sample code with a working cursor version of the situation:

    GO

    IF OBJECT_ID('TempDB..#TesteTable','U') IS NOT NULL

    DROP TABLE #TesteTable

    IF OBJECT_ID('TempDB..#TesteTableFinal','U') IS NOT NULL

    DROP TABLE #TesteTableFinal

    CREATE TABLE...

  • RE: Duplicate Rows Withe Percentage

    OK

    I'll try, i have stored in a temp table information about items that must be sent to the factory to production, several joins and calculations to get to this point.

    For...

Viewing 15 posts - 16 through 30 (of 98 total)