23 February 2010 10:02 antxxxx

formatting xml files in visual studio

This is not strictly a sql post, but it is to do with xml which is used in sql server.

 

xml files do not need to have any formatting in them. That means that when viewing an xml file produced by an application, all the data can be one line. Although this is valid xml and can be processed by sql server or ssis, sometimes it is useful to view the data in a human readable format.

 

You can use an xml editor for this, or you can open the file in visual studio and use the shortcut ctrl+k, ctrl+d which formats it all nicely with indents to make it easier to read.

Filed under: ,

Comments

# re: formatting xml files in visual studio

23 February 2010 11:54 by jamiet

Wouldn't it be great if we could do the same for T-SQL?

connect.microsoft.com/.../ssms-format-document-in-ssms

# re: formatting xml files in visual studio

23 February 2010 15:57 by timl

@jamiet - until Microsoft provides this in SSMS, you can format TSQL using Redgate SQL Refactor if you don't mind paying