Dear Friends,

SQL Server compute scalar operator performs a scalar computation and returns computed value. This calculation can be as simple as conversion of value or could be concatenation of value. Most of the times, this operator represents minimal cost as compared to the execution plan and hence overlooked. It is recommended to have a proper look when we are dealing with complex loops, cursors and if we are experiencing CPU bottlenecks.

Let us take a look into this operator using simple query statement.

CSQueryPlan

CSToolTip

To understand Expr1003, let us decode query plan in text.

CSQueryPlanText

The plan generated using compute scalar simply did the concatenation between ‘SQLServerGeeks’, ‘.’  and ‘com’. We are going to discuss more on this operator tomorrow, stay tuned.

Happy learning!

Regards,

Kanchan

Like us on FaceBookJoin the fastest growing SQL Server group on FaceBookFollow me on TwitterFollow me on FaceBook