Given a string '100+200', how do I evaluate it?
'100+200'
I want to get 300 on output.
300
DECLARE @expression VARCHAR(MAX) = '100+200' EXEC (N'SELECT ' + @expression)
If it comes from a user, make sure it's sanitized
1.4m articles
1.4m replys
5 comments
57.0k users