Forum Replies Created

Viewing 15 posts - 271 through 285 (of 544 total)

  • RE: Limiting the records?

    GilaMonster (5/29/2012)


    No, a cursor is not likely to be good, neither is a while loop. What exactly are you trying to do? Iterative processing is typically slower than set-based in...

  • RE: Limiting the records?

    Hi Dwain,

    I tried with while loop...but it is taking thrice the time of cursor....

    so what i think is, cursor is good at least for this process...

  • RE: Limiting the records?

    dwain.c (5/28/2012)


    Charmer (5/28/2012)


    anthony.green (5/28/2012)


    You certainly don't need a CURSOR to do this.

    While I am loathe to admit it, I have a couple of cases where processing a large number of...

  • RE: Limiting the records?

    anthony.green (5/28/2012)


    cursors have their place when you need to do RBAR but if you can go for set based executions.

    now depending on what your cursor is doing will depend on...

  • RE: Limiting the records?

    anthony.green (5/28/2012)


    yes, like Andy said, you need to add in a row_number clause to your select, wrap it all in a cte, then have 2 variables, set 1 as the...

  • RE: Limiting the records?

    Andy Hyslop (5/28/2012)


    You could add ROW_NUMBER() in your query and process WHERE ROW_NUMBER() < 10000 , WHERE ROW_NUMBER() BETWEEN 10001 AND 20000 ect

    Andy

    Andy, I use cursors...so is it possible to...

  • RE: Limiting the records?

    If i need to process all the records in batches , what i have to do?

    i mean if i have 50000 rows, i need to process first 10000 and then...

  • RE: How to count the rows?

    anthony.green (5/28/2012)


    declare a variable and set it to the variable + @@rowcount on each itteration

    declare @rc bigint = 0

    set @rc = @rc + @@rowcount

    It really did worked...Thank you anthony...

  • RE: TempDb crashed my server...

    michael vessey (5/18/2012)


    GilaMonster (5/17/2012)


    michael vessey (5/17/2012)


    you should be able to free up the space in the tempdb after the operation has completed using

    use tempdb

    go

    dbcc shrinkfile(2,1)

    dbcc shrinkfile(1,1)

    Please do not suggest...

  • RE: TempDb crashed my server...

    Lynn Pettis (5/17/2012)


    Do you really need to do all those LTRIM(RTRIM()) function calls in your join criteria? That is one thing that is potentially killing your query.

    yes Lynn, i...

  • RE: TempDb crashed my server...

    ChrisM@Work (5/17/2012)


    Charmer (5/17/2012)


    ChrisM@Work (5/17/2012)


    Before you ran the query, you ran "Display Estimated Execution Plan". How many rows were estimated for the insert?

    If not, and if the source of the insert...

  • RE: TempDb crashed my server...

    ChrisM@Work (5/17/2012)


    Before you ran the query, you ran "Display Estimated Execution Plan". How many rows were estimated for the insert?

    If not, and if the source of the insert was a...

  • RE: Where Statement affects Index?

    ChrisM@Work (5/11/2012)


    Charmer (5/11/2012)


    Thank you Guys...i am clear now..

    You will be if you can find the time to read this excellent article by David Durant[/url].

    Thanks Chris..Definitely i would read it...

  • RE: Where Statement affects Index?

    Thank you Guys...i am clear now..

  • RE: Where Statement affects Index?

    ChrisM@Work (5/11/2012)


    Charmer (5/11/2012)


    Hi Friends,

    I am here to discuss the general topics of index....

    One of my colleague says if we add filtering(where statement) , it will affect index. Is that true.?...

Viewing 15 posts - 271 through 285 (of 544 total)