In our software users can define various mapping functions which are partly predefined but partly require the formulation of TSQL expressions. In the case of TSQL, the double use of the '+' operator raises problems. As long, as one of the operands is numeric, the '+' is interpreted as addition. That means, that the other operands are automatically converted to numeric.
The problem arises, if the '+' is not supposed to denote an addition but a concatenation. Then normally a runtime error occurs because the operands are not necessarily all numeric. Of course, it is even worse if no error occurs when all operands are numeric and the addition is performed instead of the concatenation.
It seems to be impossible to tell the system that a concatentation has to be performed rather than an addition. One possibility would be to request the users to cast all operands explicitly to varchar - then the '+' is interpreted as concatenation. But this would require much more "computer science knowledge" by the users, thus we try to avoid that.
Are there other operators for these operations, or are there other mechanisms which might help?
Thanks for your support.