SqlTransaction problem

N

Neven Klofutar

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
 
D

David Browne

Neven Klofutar said:
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
 
N

Neven Klofutar

OK, thanx.

Neven

David Browne said:
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
 
P

prabhupr

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top