Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
An esoteric little SQL brain teaser
Message
From
20/10/2013 13:17:23
 
 
To
20/10/2013 13:11:50
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2012
Application:
Web
Miscellaneous
Thread ID:
01585872
Message ID:
01585883
Views:
58
Hey, Charles, here's the simplest example...
create table dbo.Customer (customername varchar(100))
go
insert into dbo.Customer values ('Kevin')

begin transaction 
    truncate table Customer
    rollback transaction

select * from Customer
This runs...and at the end, you'll "get your row back"

To the best of my awareness, if anyone tries to query the table from other process/connection, in the period between the truncate and the rollback in the original connection, they'll basically get locked out from a result.
Previous
Reply
Map
View

Click here to load this message in the networking platform