You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Divides one number by another and sets a value to the result of the operation. For example, if a variable @x equals 34, then @x /= 2 takes the original value of @x, divides by 2 and sets @x to that new value (17).
29
+
Divides one number by another and sets a value to the result of the operation. For example, if a variable @x equals 34, then `@x /= 2` takes the original value of @x, divides by 2 and sets @x to that new value (17).
30
30
31
31
[Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
32
32
33
33
## Syntax
34
34
35
35
```
36
-
-- Syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse
37
-
38
36
expression /= expression
39
37
```
40
38
@@ -47,10 +45,24 @@ expression /= expression
47
45
48
46
## Remarks
49
47
For more information, see [(Divide)(Transact-SQL)](../../t-sql/language-elements/divide-transact-sql.md).
48
+
49
+
## Examples
50
+
The following example, sets a variable to 17. Then uses the `/=` operator to set the variable to half of it's original value.
0 commit comments