This is what I am trying to do:
select Id, Operator form MathOperator
Results:
ID | Operator
-----------
1 | '+'
2 | '-'
*And somehow to do this:
declare @operator char(2)=
(select MathOperatorSymbol from MathOperator Where MathOperatorId = 1)
select 1 @operator 2 -- should be as: select 1+2
Is it possible?
Use dynamic SQL
exec('select 1'+ @operator + ' 2')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With