The #paymenthistory table contains the values we would to display as columns, you may add any amount of rows, the script will convert them to columns.
I am using rownumber and dynamic sql to get the final product.
:-)
To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.
Subscribing to our newsletters gets you:
Steve Jones Editor, SQLServerCentral.com