Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
goodsolution
Starting Member
38 Posts |
Posted - 2009-05-12 : 17:08:31
|
| In query window 1:-Begin transactioninsert into student (sd_id, name)values (1, 'aaa')insert into student (sd_id, name)values (2, 'bbb')-- Remember I didn't commit transactionIn query window 2:- select * from studentQ1. What should I get from select statement in query window 2?Q2. I mean to say, should it return the two values which were inserted in query window 1? I believe it shouldn't return as transaction didn't commit. I don't want touch query window 1. But I want to have those two values in query window 2. What should I write in query window 2 in order to get those two values? Any idea??-Thanks |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2009-05-12 : 17:17:21
|
| This will get the dirty data in the other window, otherwise the spid will get blocked until the transaction ends:SELECT * FROM Student WITH (NOLOCK) |
 |
|
|
|
|
|