T-SQL Script to display dynamically horizontal rows vertically

Consider below scenario :Table 1:DEPARTMENTEMPIDENAMESALARYA/C1TEST12000SALES2TEST23000Table 2:ColumnName12DEPARTMENTA/CSALESEMPID12ENAMETEST1TEST2SALARY20003000If we are required to transform resultset in Table1 format to Table2 format :How to display dynamically horizontal row

 
 
 
 
 
(2)
787 times
Add to favorites
Databases
9/14/2013
E-mail Twitter del.icio.us Digg Facebook