Reputation: 5929
This is something I know can be done somehow, because I've done it before, but I can't for the life of me remember how.
I want to export the structure of an SQL Server database to an XML file. The one that I have from last time we did this has this kind of structure:
<Data>
<Details>
<Server>Server Name</Server>
<Database>Database Name</Database>
</Details>
<Tables>
<Table>
<Name>Table Name</Name>
<Columns>
<Column>
<Colname>Column Name</Colname>
</Column>
</Columns>
</Table>
</Tables>
<Procedures>
<Procedure>
<Name>Procedure Name</name>
<Definition>Full text of script</Definition>
</Procedure>
</Procedures>
</Data>
...And so on. Does anyone know where to find this option?
Upvotes: 3
Views: 1493
Reputation: 5929
Aha. It wasn't a built in feature after all - we use SQL Delta (http://www.sqldelta.com/), and its "Snapshot" feature was what was used.
Upvotes: 2
Reputation: 45117
DatabaseSpy can do this and has a 30-day trial.
Per comment: You might be able to do it with SSIS and you could certainly do it with some FOR XML queries against the system tables.
Upvotes: 2