Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
An esoteric little SQL brain teaser
Message
De
20/10/2013 06:14:11
 
 
À
20/10/2013 03:37:52
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:
01585873
Vues:
81
>Here's a little brain teaser. This could be a "who's buried in Grant's tomb" question....or it might be a trick question.
>
>Here we go. In SQL Server, suppose you're in a SQL transaction. During the transaction, you truncate a table by issuing the TRUNCATE TABLE statement. Let's say the table had 100 rows before the TRUNCATE.
>
>Here's the question - can you issue a ROLLBACK statement and bring back the 100 rows?
>
>
>Obviously, you could cheat and try it out in SQL Server, so I'm asking for honesty.
>
>There's a story behind this question.....

I have no experience to back this up but since TRUNCATE TABLE does no logging, I'd intuit that there's no ROLLBACK possible and would use DELETE instead if I wanted ROLLBACK.
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform