In `SSIS` there is a task called Pivot transformation that changes columns into rows,
but how to do the same task in sql server using t-sql ?

this is my sample table

```
location product qty
-----------------------
delhi     PEPSI   100
GURGAON   CAKE    200
NOIDA     APPLE   150
delhi     cake    250

```

so after the pivot transformation ON location as setkey and product as pivot key using ssis tool the o/p becomes

```
location pepsi cake apple
delhi     100 null null
GURGAON   null 200 null 
NOIDA     null null 150 
delhi     null 250  null

```