473,385 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SqlTransaction problem

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
Nov 23 '05 #1
3 1280

"Neven Klofutar" <neven.klofutar@**re...m.o..v...e**vip.hr> wrote in message
news:e8**************@TK2MSFTNGP09.phx.gbl...
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 23 '05 #2
OK, thanx.

Neven

"David Browne" <davidbaxterbrowne no potted me**@hotmail.com> wrote in
message news:O7**************@TK2MSFTNGP14.phx.gbl...

"Neven Klofutar" <neven.klofutar@**re...m.o..v...e**vip.hr> wrote in
message news:e8**************@TK2MSFTNGP09.phx.gbl...
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 24 '05 #3
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 me**@hotmail.com> wrote in
message news:O7**************@TK2MSFTNGP14.phx.gbl...

"Neven Klofutar" <neven.klofutar@**re...m.o..v...e**vip.hr> wrote in
message news:e8**************@TK2MSFTNGP09.phx.gbl...
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 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: mahajan.sanjeev | last post by:
I have two SQLConnection objects having the same connection string and two corresponding SQLCommand objects for each connection object. I am using SQLTransaction with the first SQLConnection object...
2
by: mahajan.sanjeev | last post by:
Hi, I am having problems with rollback using the SQLTransaction object. I am trying to insert records in two tables in a transaction. I want to rollback all the changes if any exception occurs...
0
by: mahajan.sanjeev | last post by:
Hi All, I am using a SQLTransaction in a .Net application to insert records into a SQL Server table. At one time, there are 5000 or more records to be inserted one by one. It takes some 20-25...
0
by: perspolis | last post by:
Hi all I used SqlTransaction inmy application.. SqlTransaction transact=sqlConnection1.BeginTransaction(IsoLationLevel.Something); sqlSelect.Transaction=transact; sqlInsert.Transaction=transact;...
2
by: .Net Newbie | last post by:
Hello, I am somewhat new to .Net and currently working on an intranet site using C# going against SQL Server 2k. I am accepting personal information on a single webform and trying to insert the...
0
by: Joe Rigley | last post by:
Hi All, I am using a SqlTransaction object to process a group of database insert / update statements on Sql Server 200 SP4 to complete a business process. Directly after the Commit method is...
5
by: Swami Muthuvelu | last post by:
Hi, I using command builder to generate my insert, update and delete statements..something like, data_adapter = New SqlClient.SqlDataAdapter(SQL, ActiveConnection) command_builder = New...
4
by: perspolis | last post by:
Hi all I have a master-detail tables in sql server. I use SqlTransaction to insert data into both tables. it works well but if I check the "Cascade Delete Related Records" option in it's realtion...
3
MrMancunian
by: MrMancunian | last post by:
Ok, I'm stuck on a design problem and I need some feedback how to go around it. CASE: Pathologists can request stains on certain tissues. It's possible to request more than one stain a time....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.