Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Posts
    9

    Question Unanswered: Rollback when debugging t-sql sprocs in VS2005

    Hi,

    Is it possible to rollback changes made to the DB when debugging a t-sql sproc in VS2005? i.e. step through the sproc, then hit rollback and be able to step through it again in the same state

    Thanks, moff.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Not 100% certain what you mean. You can stick a
    Code:
    BEGIN TRAN
    at the beginning and a
    Code:
    ROLLBACK TRAN
    at the end and all changes you make in your sproc will rollback and the system will be in the same state as when you started.

    That what you mean?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Feb 2007
    Posts
    9
    Quote Originally Posted by pootle flump
    Not 100% certain what you mean.
    nor am i a developer was asking me about it this morning

    Quote Originally Posted by pootle flump
    You can stick a
    Code:
    BEGIN TRAN
    at the beginning and a
    Code:
    ROLLBACK TRAN
    at the end and all changes you make in your sproc will rollback and the system will be in the same state as when you started.

    That what you mean?
    i guess that would do the job, although the aforementioned developer said that this functionality was available in query analyser in 2000 implemented with a checkbox called 'auto-rollback'

    thanks, moff.

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Gotta admit - since the T-SQL debugging is so frustrating after you are used to the .NET debugging tools I don't really use them at all. I just code writes to tables and stuff like rollback tran and run the procs as normal.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Feb 2007
    Posts
    9
    ok, ta anyway

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •