Skip to content

Commit 0cbf56e

Browse files
Update README.md
1 parent ceda7b7 commit 0cbf56e

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

README.md

+11-13
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,20 @@
2323

2424

2525
```sql
26-
DECLARE @tableFormula TABLE
27-
(
28-
Formula VARCHAR(255) ,
29-
X INT ,
30-
Y INT ,
31-
Z INT
32-
)
33-
34-
INSERT INTO @tableFormula
35-
VALUES ( 'x+y*z', 1, 2, 3 ),
36-
( '(x+y)*z', 1, 2, 3 )
26+
-- Evaluate dynamically expression in T-SQL
27+
DECLARE @tableFormula TABLE (
28+
Formula VARCHAR(255), X INT, Y INT, Z INT
29+
)
3730

31+
INSERT INTO @tableFormula VALUES ('x+y*z', 1, 2, 3 ),
32+
('(x+y)*z', 1, 2, 3 )
3833
-- SELECT 7
3934
-- SELECT 9
40-
SELECT SQLNET::New(Formula).Val('x', X).Val('y', Y).Val('z', Z).EvalInt()
41-
FROM @tableFormula
35+
SELECT SQLNET::New(Formula)
36+
.Val('x', X)
37+
.Val('y', Y)
38+
.Val('z', Z).EvalInt()
39+
FROM @tableFormula
4240
```
4341

4442
## Download

0 commit comments

Comments
 (0)