File tree Expand file tree Collapse file tree
docs/t-sql/language-elements Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6363IF @@TRANCOUNT = 0
6464BEGIN
6565 SELECT FirstName, MiddleName
66- FROM Person .Person WHERE LastName = ' Adams'
67- ROLLBACK TRANSACTION
68- PRINT N' Rolling back the transaction two times would cause an error.'
69- END
70- ROLLBACK TRANSACTION
71- PRINT N' Rolled back the transaction.'
66+ FROM Person .Person WHERE LastName = ' Adams' ;
67+ ROLLBACK TRANSACTION;
68+ PRINT N' Rolling back the transaction two times would cause an error.' ;
69+ END;
70+ ROLLBACK TRANSACTION;
71+ PRINT N' Rolled back the transaction.' ;
7272GO
7373/*
7474Rolled back the transaction.
@@ -81,13 +81,13 @@ Rolled back the transaction.
8181``` sql
8282-- Uses AdventureWorks
8383
84- DECLARE @Iteration Integer = 0
84+ DECLARE @Iteration Integer = 0 ;
8585WHILE @Iteration < 10
8686BEGIN
8787 SELECT FirstName, MiddleName
88- FROM dbo .DimCustomer WHERE LastName = ' Adams'
89- SET @Iteration + = 1
90- END
88+ FROM dbo .DimCustomer WHERE LastName = ' Adams' ;
89+ SET @Iteration + = 1 ;
90+ END;
9191```
9292
9393## See Also
You can’t perform that action at this time.
0 commit comments