1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
CREATE TABLE dbo.BilanPatrimoine(
UserNum int NULL,
libelle varchar(255) NULL,
valeur int NULL,
unite varchar(255) NULL)
CREATE TABLE dbo.user_1(
Id int NULL)
insert into user_1 values (1);
insert into user_1 values (2);
insert into BilanPatrimoine values (1,'Libelle1',1233,'EUR');
insert into BilanPatrimoine values (1,'Libelle2',123,'EUR');
insert into BilanPatrimoine values (2,'Libelle1',1000,'EUR');
select
'05/08/2010' as "date",
Id as "logo",
(select (select libelle as "ligne/libelle",
valeur as "ligne/valeur",
unite as "ligne/unite"
from BilanPatrimoine inner join user_1
on Id = UserNum
for xml path ('patrimoine'),type, elements)
for xml path ('synthese'),type, elements)
from user_1
for xml path ('doc'), root ('docs'), type, elements |
Partager