SQL Server and XBRL

2.3k views Asked by At

I'm going to have to create an XML output in XBRL format right out of SSMS (through a stored procedure or a function or something else which I will have to code).

My issue is that I have never worked with XML on SQL Server (although I've googled it a bit now and kind of got the idea of it) and what examples I found while searching were using SSIS and packages to create XBRL files.

I would like to know if it is possible to do it this way, using SSMS (if it's not too much hassle with this tool) and if anyone has tried it and succeeded, and maybe I can get some advice what resources to look for (books, links etc.) or examples.

2

There are 2 answers

1
podiluska On

You can create XML data quite easily from your data, using the FOR XML query modifier (see http://technet.microsoft.com/en-us/library/ms178107.aspx ).

However, creating a "file" involves file IO, which is not what SQL server is for. You could use a CLR stored procedure for this, or a separate application.

3
David vun Kannon On

While it is true that XBRL documents are just XML, there are multiple kinds of XBRL documents - instance documents, taxonomy schemas, and taxonomy linkbases, for example. Which kind are you intending to create?

Even if we just focus on instance documents, they contain the facts, contexts, and units. Each of these XML fragments is probably the output of different queries, depending on the databse schema.

It is hard to say more without a clearer description of a specific problem.