|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 8:20 AM
Points: 220,
Visits: 350
|
|
| As a long-time Oracle DBA and a new MSSQL DBA I find this whole concept mind-boggling. If it hadn't been for the prior isolation-level question (which I missed) and then yesterday's (Guest) Editorial I would've gotten today's question wrong too.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Wednesday, April 07, 2010 7:40 AM
Points: 42,
Visits: 88
|
|
I expected to get no records because the transaction was still open but, when I ran it on SQL 2008 I got an error message saying "Msg 208, Level 16, State1, Line 3. Invalid object name 'test_tran'. Since this is the actual result I got I selected "None of the above" as the correct answer and was told I was wrong. I think I should get my "point" because my answer was technically correct.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 2:26 PM
Points: 1,132,
Visits: 663
|
|
Good question because it made us think....I missed it, but I learned something which is really the point....It's very tough to cover all your bases on these questions....
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Tuesday, December 07, 2010 8:13 AM
Points: 436,
Visits: 322
|
|
Mine ran for a while with no results so being the impatient person I am I decided to see what would happen if I ran the first one again. Upon doing so it returned the first 2 rows (1 and 2) in the second query. I am using SQL Server 2005.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, March 22, 2009 10:55 PM
Points: 1,
Visits: 1
|
|
dear Friends,
i have testing this question and return all values (1,2,3) if i execute it 
thx
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Friday, March 15, 2013 2:43 PM
Points: 3,924,
Visits: 1,554
|
|
Good question. I didn't read it correctly and executed in same window. Which gave me 1,2,3 but after it got wrong, then tried it in another window and it was still running.
Will see if it returns something after sometime.
SQL DBA.
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Friday, March 15, 2013 2:43 PM
Points: 3,924,
Visits: 1,554
|
|
h84liang (3/19/2009)
dear Friends, i have testing this question and return all values (1,2,3) if i execute it  thx
Dude, read question correctly. It say's execute it in another window and not the same. Try again.
SQL DBA.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, August 10, 2012 6:08 PM
Points: 1,156,
Visits: 801
|
|
Sometimes missing information in a question induces thought, teaches, and also helps one to permanently retain what was learned.
I think this was a great question, and also the points brought out in discussion.
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Today @ 6:08 PM
Points: 21,589,
Visits: 27,391
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: 2 days ago @ 8:29 AM
Points: 2,794,
Visits: 1,123
|
|
At first I was confused about why it would not return the already committed data and I did an experiment by changing the code. Very interesting question. Thanks!
--first window CREATE TABLE Test_Tran(id int identity, col1 int) ALTER TABLE Test_Tran ADD CONSTRAINT [pk_Test_Tran] PRIMARY KEY CLUSTERED (id ASC) insert into Test_Tran values(1) insert into Test_Tran values(2) Begin Tran insert into Test_Tran values(3)
--second window SET TRANSACTION ISOLATION LEVEL READ COMMITTED select * from a_test_tran where id < 3
--results id col1 ----------- ----------- 1 1 2 2
(2 row(s) affected)
|
|
|
|