none
dateadd on a million rows

    Question

  • Hi All,

    I have scenario where i need to update a few million row(db is in sybase).

    what trying to do is add few hours to each row in time col with dateadd function.

    Since there are a million rows  ,i am certain that i will blow away my tran log.

    Looking for suggestions on how i should accomplish it.

    thank you in advance for the help.

    Thursday, July 17, 2014 9:47 PM

All replies

  • This is a SQL Server forum.  Not a Sybase one.

    David


    David http://blogs.msdn.com/b/dbrowne/

    Thursday, July 17, 2014 9:48 PM
  • i think you will like this http://en.wikipedia.org/wiki/Sybase_SQL_Server :) 

    And the question can have generic answer . i am not asking you to code it for me for a platform.

    Friday, July 18, 2014 2:20 AM
  • i think you will like this http://en.wikipedia.org/wiki/Sybase_SQL_Server :) 

    And the question can have generic answer . i am not asking you to code it for me for a platform.


    what you can do is to split data into batches based on PK values and then update each batch in turn. you can write a cursor/looping logic for that

    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

    Friday, July 18, 2014 3:57 AM
  • Hi,

    Please check if you can add a "Expression Column" or a "Computed Column" with the required expression to your table and then make use of this newly added column.

    I am not sure how helpful it would prove in your case, but just a thought!


    -Vinay Pugalia
    If a post answers your question, please click "Mark As Answer" on that post or "Vote as Helpful".
    Web : Inkey Solutions
    Blog : My Blog
    Email : Vinay Pugalia

    Friday, July 18, 2014 11:20 AM
  • Hi Vinay,

    Thanks for sharing the idea, but i cannot add another column.

    Hi Visakh,

    Thanks for sharing, and that seems like a plausible idea. i will look into the existing structure of the table to see how it works.

    Thank you

    Friday, July 18, 2014 12:47 PM
  • i think you will like this http://en.wikipedia.org/wiki/Sybase_SQL_Server :) 

    And the question can have generic answer . i am not asking you to code it for me for a platform.

    SQL Server is often, and frequently used to refer to Microsoft SQL Server as I am sure you're aware.

    The fact remains all we can really do is take guesses at the fix to your problem. You would be better served by asking your question on a Sysbase forum, not a Microsoft one. Alternatively, you could try calling SAP support. Hahahaha!

    Friday, July 18, 2014 2:21 PM
  • Indeed Good Sir, i was going with my wikipedia knowledge which says "code base for MS SQL Server was sold by Sybase SQL Server to Microsoft"

    hahaha .. good luck with SAP support for sybase. :P 


    Friday, July 18, 2014 2:33 PM