|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 9:56 AM
Points: 77,
Visits: 595
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 11:29 AM
Points: 1,383,
Visits: 1,084
|
|
Nice article...thanks.
- Chris
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 9:56 AM
Points: 77,
Visits: 595
|
|
Part 1: http://www.sqlservercentral.com/articles/XML/87539/
Part 2: http://www.sqlservercentral.com/articles/XML/87685/
Part 3: http://www.sqlservercentral.com/articles/XML/87637/
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, May 02, 2013 7:17 AM
Points: 34,
Visits: 290
|
|
The approach presented works well for a single client. I'm not sure how it would work in the current format if multiple clients needed to be shown. Something like this would work well for multiple clients.
select *, ( select * from dbo.sales s where s.clientid = c.clientid for xml path ('Sale'), type ) as Sales, ( select * from dbo.vendor for xml path ('Vendor'), type ) from dbo.clients c for xml path ('Clients'), root ('ClientOrders')
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 9:56 AM
Points: 77,
Visits: 595
|
|
| In the next article out next Wednesday I create an SSIS package that emails/ftps invoices to individual customers. That's why I wrote it for one customer at a time.
|
|
|
|