Created
January 30, 2019 15:49
-
-
Save alinciuca/65b6ab7a4f90735f7e1945488383afbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select count (*) as BeforeTruncateCount | |
from TableName; | |
declare @Transaction varchar(20) = 'Transaction1'; | |
begin tran @Transaction | |
truncate table TableName; | |
select count (*) as AfterTruncate | |
from TableName; | |
rollback tran @Transaction; | |
select count (*) as AfterRollback | |
from TableName; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment