Today’s an impromptu post, and the intention is to draw attention to a “hidden” feature of the SQL Server Management Studio (SSMS).
Recently, we were working on designing changes that were required in an XML that was required to be exchanged between the application and the database. The team had gathered in a meeting room for a technical design session – a couple of application developers, a database developer and a database administrator.
We had the SQL Server Management Studio running to look at the table design and create/query test data. To edit the existing XML, the application developers launched an instance of the Visual Studio IDE. The database developer and administrator immediately mentioned that there was no need to launch Visual Studio. The question that came from the application team was - “Why?” The simple answer is
SSMS comes with it’s own XML editor!
Here’s the problem though – it’s not obvious. The XML editor in the SSMS is an extension to the query editor window, which is probably why it’s not obvious. The tools and options related to XML editing are only available if an XML document is actually opened within the SSMS. I prepared a sample XML document for this post, and simply opened it using the SSMS. This is how the SSMS interface changes.
Notice that in the Text Editor toolbar, we now have the additional operations enabled (from Left to Right):
- Create XML schema based on given XML document
- Reformat Selection
- Format the whole Document
- Show XSLT output
- Debug XSLT
- Cancel XSLT output
The reason one can edit XML documents within the SSMS is because the SSMS is ultimately a Visual Studio shell, inheriting call features common at the shell.
Do you use the XML editor within SSMS? Do leave a note as you go.
Until we meet next time,
Be courteous. Drive responsibly.