Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
An esoteric little SQL brain teaser
Message
De
20/10/2013 13:17:23
 
 
À
20/10/2013 13:11:50
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01585872
Message ID:
01585883
Vues:
57
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform