What is the easiest way to export a SQLServer 2000 database to XML?

I have an old SQL Server 2000 database that I want to get in XML, so I can import part of it into the SQLite database for the PHP website from there.

I accessed a SQL Server 2000 database using SQL Server Management Studio 2008 Express , I can open all tables, view data, etc.

I expected that I could, for example, right-click in "Tables" and select "Export all tables to XML", but cannot find an export function like this.

The easiest way to export this SQL Server database to XML files, I don’t even need a schema (int, varchar, etc.), just data.

+6
xml sql-server export data-transfer
source share
2 answers
SELECT * FROM {tablename} FOR XML AUTO 

works fine in this particular case, thanks ogiboho via twitter

+8
source share

You can write a .NET application that extracts tables into a dataset and then retrieves the XML from the dataset ...

http://msdn.microsoft.com/en-us/library/zx8h06sz.aspx

Alternatively, you can see this message on the forum, it has many different ways to achieve this ...

http://sqlxml.org/faqs.aspx?faq=29

+1
source share

All Articles