How to find last updated row in the stored procedure

  • Hello,

    Anyone can help me

    I have updated one stored procedure without commended out which line need to modify.

    Now I want to inform the client which line i have modified.

    Could anyone help me this how to find the last modified row in the stored procedure

    Thanks,

    Tony

  • unless your procedure is specifically updating a datetime column, or you have a ROWVERSION datatype as one of the columns in the table, it is not possible to determine the last modified row of a table.

    you will need to logically deduce which rows are affected based on the WHERE statement(or lack thereof)

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I think he's reffering to the code specifically.

    If this is the case and that the new sp has erased the old sp you could restore an old backup to a new db name and get the definition there.

    Other than that unless you have a copy in a e-mail or some change control system (or maybe even the install cd of the program), then you are out of options.

  • tonyarp05 61903 (8/8/2011)


    Hello,

    Anyone can help me

    I have updated one stored procedure without commended out which line need to modify.

    Now I want to inform the client which line i have modified.

    Could anyone help me this how to find the last modified row in the stored procedure

    Thanks,

    Tony

    Your source code control system could do this easily. As could using WinMerge or something similar to compare 2 stored file copies of the text (before and after change). Outside of that, you could restore an older copy of the database and script out the prior version of the sproc and again to the WinMerge thing.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • I'm a fan of SubVersion (aka tortoise SVN) for source control. It makes versioning very easy. I have most of my clients also set up with SubVersion. You can sync up development folders on your own machine that sync up to the same folders at the client site.

    It makes this sort of thing almost trivial - each side can easily have the most recent code. There are some other source control packages out there that I hear great things about, but I've never used them.

    Todd Fifield

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply