We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e211be2 + f76c43f commit 0639bf9Copy full SHA for 0639bf9
1 file changed
docs/t-sql/language-elements/break-transact-sql.md
@@ -32,6 +32,7 @@ BREAK is usually inside an IF statement.
32
33
## Examples
34
35
+### Example for SQL Server
36
```sql
37
WHILE (1=1)
38
BEGIN
@@ -45,6 +46,26 @@ BEGIN
45
46
END
47
```
48
49
+### Example for Azure Synapse Dedicated SQL Pool
50
+```sql
51
+declare @sleeptimesec int = 5;
52
+declare @startingtime datetime2 = getdate();
53
+
54
+PRINT N'Sleeping for ' + cast(@sleeptimesec as varchar(5)) + ' seconds'
55
+WHILE (1=1)
56
+BEGIN
57
58
+ PRINT N'Sleeping.';
59
+ print datediff(s, getdate(), @startingtime)
60
61
+ if datediff(s, getdate(), @startingtime) < -@sleeptimesec
62
+ begin
63
+ print 'We have finished waiting.'
64
+ break;
65
+ end
66
+END
67
+```
68
69
## See Also
70
71
- [Control-of-Flow Language (Transact-SQL)](~/t-sql/language-elements/control-of-flow.md)
0 commit comments