I have the Data in this format in my temporary table.Column1 contains the TableName and Column2 contains the ColumnName in that Particular table.
Tele callcount
Tele staffcount
Sche call count
Sche callcount
Here callcount,StaffCount are the names of the columns in the Tele table as well as in the MetricTable.
The Data in the Tele Table and the Sche Table looks similar to this
BatchID,callcount,staffcount,ID
200,5,45,12215
201,6,12,12215
Now I need to get the Columnname in my temporary table and based on the Column name i need to get the value in that particular column without using loops and cursors. Can this be done in SQL?