Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Table structure into xml URGENT

Author  Topic 

rupal kankaney
Starting Member

2 Posts

Posted - 2007-08-06 : 03:10:54
Hi All

I want to convert table structure into xml in the following format.

Eg: <TABLE_NAME>
<COLUMN_NAME>
<IS_NULLABLE> </IS_NULLABLE>
<CONSTRAINT_TYPE> </CONSTRAINT_TYPE>
<CONSTRAINT_NAME> </CONSTRAINT_NAME>
<TABLE_CATALOG> </TABLE_CATALOG>
<LENGTH> </LENGTH>
</COLUMN_NAME>
</TABLE_NAME>

where TABLE_NAME is the table name in database and COLUMN_NAME is name of the column in above table and the remaning are the attributes to that column.
please suggesst me the sql query to get the following structre of any table in database,

Thanks
Rupal

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-08-06 : 05:53:32
select ....
from...
where....
FOR XML AUTO, ELEMENTS

look up other options of FOR XML to see if they suit you

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -