Hi All
i am facing problem in convertin sql to xml
Query
[code=sql]
select top 1 C.TABLE_NAME ,C.COLUMN_NAME, C.DATA_TYPE,C.I S_NULLABLE,TC.C ONSTRAINT_TYPE ,isnull(C.chara cter_maximum_le ngth ,isnull (C.character_oc tet_length,C.nu meric_precision ))as LENGTH
FROM INFORMATION_SCH EMA.COLUMNS C
left outer JOIN INFORMATION_SCH EMA.TABLE_CONST RAINTS TC
ON C.TABLE_NAME = TC.TABLE_NAME
WHERE C.TABLE_CATALOG = 'D1Master'
for XML auto ,elements[/code]
o/p[code=xml]
<C><TABLE_NAME> v_img_work_d1_b ranch</TABLE_NAME><COL UMN_NAME>Active _Flg</COLUMN_NAME><DA TA_TYPE>int</DATA_TYPE><IS_N ULLABLE>YES</IS_NULLABLE><TC ><LENGTH>10</LENGTH></TC></C>[/code]
***But the o/p which i need should be like table name and column name should be ended in last not just like above query
Thanks
Rupal
i am facing problem in convertin sql to xml
Query
[code=sql]
select top 1 C.TABLE_NAME ,C.COLUMN_NAME, C.DATA_TYPE,C.I S_NULLABLE,TC.C ONSTRAINT_TYPE ,isnull(C.chara cter_maximum_le ngth ,isnull (C.character_oc tet_length,C.nu meric_precision ))as LENGTH
FROM INFORMATION_SCH EMA.COLUMNS C
left outer JOIN INFORMATION_SCH EMA.TABLE_CONST RAINTS TC
ON C.TABLE_NAME = TC.TABLE_NAME
WHERE C.TABLE_CATALOG = 'D1Master'
for XML auto ,elements[/code]
o/p[code=xml]
<C><TABLE_NAME> v_img_work_d1_b ranch</TABLE_NAME><COL UMN_NAME>Active _Flg</COLUMN_NAME><DA TA_TYPE>int</DATA_TYPE><IS_N ULLABLE>YES</IS_NULLABLE><TC ><LENGTH>10</LENGTH></TC></C>[/code]
***But the o/p which i need should be like table name and column name should be ended in last not just like above query
Thanks
Rupal
Comment