SqlTransaction problem

Discussion in 'ASP .Net' started by Neven Klofutar, Nov 23, 2005.

  1. Hi,

    I'm trying to retrieve some information from DB using SqlTransaction, but I
    have a problem.
    I'm executing some DELETE SQL statements using Transaction. Then later on
    (because of the lousy project) I need to read the same information from DB
    that is beeing deleted using the same transaction.

    Is it possible to delete data, and read the same data in one SqlTransaction,
    or that Transaction cannot read the data anymore even if Commit() haven't
    been executed jet ?

    thanx, Neven
     
    Neven Klofutar, Nov 23, 2005
    #1
    1. Advertising

  2. Neven Klofutar

    David Browne Guest

    "Neven Klofutar" <neven.klofutar@**re...m.o..v...e**vip.hr> wrote in message
    news:...
    > Hi,
    >
    > I'm trying to retrieve some information from DB using SqlTransaction, but
    > I have a problem.
    > I'm executing some DELETE SQL statements using Transaction. Then later on
    > (because of the lousy project) I need to read the same information from DB
    > that is beeing deleted using the same transaction.
    >
    > Is it possible to delete data, and read the same data in one
    > SqlTransaction, or that Transaction cannot read the data anymore even if
    > Commit() haven't been executed jet ?
    >


    Changes made in the transaction are immediately visible inside the
    transaction. Outside the transaction, the the rows are locked.

    Perhaps you could dump the data into a temp table before you delete it.

    David
     
    David Browne, Nov 23, 2005
    #2
    1. Advertising

  3. OK, thanx.

    Neven

    "David Browne" <davidbaxterbrowne no potted > wrote in
    message news:...
    >
    > "Neven Klofutar" <neven.klofutar@**re...m.o..v...e**vip.hr> wrote in
    > message news:...
    >> Hi,
    >>
    >> I'm trying to retrieve some information from DB using SqlTransaction, but
    >> I have a problem.
    >> I'm executing some DELETE SQL statements using Transaction. Then later on
    >> (because of the lousy project) I need to read the same information from
    >> DB that is beeing deleted using the same transaction.
    >>
    >> Is it possible to delete data, and read the same data in one
    >> SqlTransaction, or that Transaction cannot read the data anymore even if
    >> Commit() haven't been executed jet ?
    >>

    >
    > Changes made in the transaction are immediately visible inside the
    > transaction. Outside the transaction, the the rows are locked.
    >
    > Perhaps you could dump the data into a temp table before you delete it.
    >
    > David
    >
     
    Neven Klofutar, Nov 24, 2005
    #3
  4. Neven Klofutar

    Guest

    if this does not work, look into SQL Triggers and within that look for
    "DELETED" table data


    Neven Klofutar wrote:
    > OK, thanx.
    >
    > Neven
    >
    > "David Browne" <davidbaxterbrowne no potted > wrote in
    > message news:...
    > >
    > > "Neven Klofutar" <neven.klofutar@**re...m.o..v...e**vip.hr> wrote in
    > > message news:...
    > >> Hi,
    > >>
    > >> I'm trying to retrieve some information from DB using SqlTransaction, but
    > >> I have a problem.
    > >> I'm executing some DELETE SQL statements using Transaction. Then later on
    > >> (because of the lousy project) I need to read the same information from
    > >> DB that is beeing deleted using the same transaction.
    > >>
    > >> Is it possible to delete data, and read the same data in one
    > >> SqlTransaction, or that Transaction cannot read the data anymore even if
    > >> Commit() haven't been executed jet ?
    > >>

    > >
    > > Changes made in the transaction are immediately visible inside the
    > > transaction. Outside the transaction, the the rows are locked.
    > >
    > > Perhaps you could dump the data into a temp table before you delete it.
    > >
    > > David
    > >
     
    , Nov 26, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. .Net Newbie
    Replies:
    2
    Views:
    722
    =?Utf-8?B?RGVlcA==?=
    Jul 9, 2004
  2. Piotr Strycharz

    SqlTransaction issue

    Piotr Strycharz, Dec 15, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    621
    Piotr Strycharz
    Dec 16, 2004
  3. Joe Rigley

    SqlTransaction Record Not Found

    Joe Rigley, Nov 11, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    386
    Joe Rigley
    Nov 11, 2005
  4. Replies:
    0
    Views:
    1,672
  5. pers

    SqlTransaction problem

    pers, Jul 12, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    712
    Mr. Arnold
    Jul 13, 2010
Loading...

Share This Page