Plot query results in BaseX GUI - basex

It seems that plotting in BaseX GUI is only available for databases, plotting XQuery results or XML files set to context (right-click on an XML document in the Project view, and choose Set as context) is not possible. Am I correct ?
Thanks,

Related

Alternative way to load XML data in database with SSIS

I am searching for an alternative way to load XML data in database with SSIS.
Why alternative ? Because we have had some very bad experiences with SSIS and XML:
SSIS not raising error when XML is not matching the XSD (unexpected fields were present in XML)
SSIS not able to load basic XML because the structure didn't suit him (we have finished by editing the XML on the fly to change the structure)
low performance
(very) cumbersome development with complex XML with parent-child nodes
when looping on several XML, SSIS skips some of them, without raising any error, it's like if they were invisible. If you run again the treatment, it works.
So I would like to avoid these issues by using an alternative way to load XML with SSIS.
Why still using SSIS ? Because it has some benefits anyway:
centralized management and monitoring
specific audit flow, allowing to follow loading of XML, Txt files, tables, etc.
developers skilled on SSIS
So I am searching how to do something close to:
Loop on a folder where are several XML -> SSIS component
For each XML, Insert a value in audit table marking it as "in treatment"
Validate XML with XSD and raise error if mismatch -> ?
If error, move the XML in a reject folder or flag the XML in audit table as "error" -> ?
If no error, Parse XML as a DOM (or equivalent) -> ?
Insert in database tables the content of XML, by keeping the link between parent and child node. So it means I need to be able to retrieve on the fly some sequences from SQLServer database -> ?
Update the audit table to set the XML as "Loaded" -> ?
Move the XML in another folder
Without SSIS in the equation, I would use java program or python but I would like to keep SSIS at least as a container.
Thanks a lot

tfs 2010 database bug location

I am looking at a sql server database for a tfs 2010 install and I am trying to find bugs/files logged by date.
Is this information contained in the database?
I see other information such as a view named WorkItemChanges which shows all the stories that have been changed by date.
* Directly querying the collection database is unsupported *
The Tfs{YourProjectCollection} database contains all work items for a specific project collection. They live in the different Work Item tables, since a bug is a specific type of work item.
If your TFS environment is configured for reporting using Report Server, then you can use the Analysis cube or the TFSWarehouse databases to query this kind of information. For work items, a limited set of fields is stored and the same goes for files in source control. You should at least be able to find out which have changed. The following doc describes the warehouse structure: Creating, Customizing and Managing reports for Visual Studio ALM. A quick way to get started is from the Excel Powerpivot reports which are installed to your team project by default if your TFS instance is connected to a Sharepoint server with teh appropriate features enabled.
* You have a number of alternatives *
I suppose that your Visual Studio is currently working, if that's the case then there is no need to use a SQL query to get to the information you're after.
To query all bugs (or other work item types) that have changed between two dates, create a work item query (in Visual Studio) that looks like this:
You can import these into Excel for easy manipulation or further aggregation. And you can even quickly create a Report from that. More information can be found in the Bulk Add or Modify work items in Excel.
To query all files changed between a specific date range, is a little harder. You can quickly get all changesets between two dates using the commandline using tf history $/Project /collection:yourprojectcollectionUri /recursive /version"D2012-10-10~D2013-10-10" this will popup window with all changesets between these dates. You can specify /noprompt /format:detailed to dump all details to the command prompt window.
Alternatively, you can do a folder diff between two dates. This can be done from the UI in the Source Control Explorer. Or from the commandline using tf diff or tf folderdiff

How to create query specific projections with Vertica Database Designer?

How should the script be fed to Vertica's database designer when I want to create query-specific projections ?
Can I write more then one SELECT statement inside the file that will be provided as input to the DB designer?
Create a text file with the queries you want to optimize for. When prompted in the DBD process, point it to that file.
When I was working on/discussing optimxation using Vertica Database Designer it seems like the recommended upper limit for queries in the file was 100.
If you want to weigh a query more heavily, put that in multiple times.

How to build a database from an XSD schema and import XML data

I have a complex XSD schema and hundreds of XML files conforming to the schema.
How do I automate the creation of related SQL Server tables to store the XML data?
I've considered creating C# classes from the XSD schema using the xsd.exe tool and letting something like Subsonic figure out how to make a shiny database out of it, but not sure if it's the best way to approach it.
Has anyone managed to elegantly import XSD files into SQL Server?
A similar question with good answers: How can I create database tables from XSD files?
I suggest you use SQL Server Integration Services, which comes with SQL Server 2008 or 2005 (Or Data Transformation Services if your stuck with 2000).
Unfortunately it doesn't come with the free "Express" version of SQL Server, however SQL Server Developer edition can be had for < $100 which has the full SQL Server Standard functionality and would suit your needs.
SSIS is a big topic and I'm not going to go over all of the bells and whistles here but basically you:
Create a new SSIS project using BIDS (Business Intelligence Development Studio, a modified Visual Studio that comes with SSIS)
Drag a new Data Flow Task onto the Control Flow surface, then click the data flow tab.
Drag an "XML source" from toolbox into data flow panel, and then configure the XSD and XML file locations.
Drag an ADO.NET data destination from the toolbox onto the dataflow and connect one of the the outputs from the XML source to the input of the ADO.NET destination. If you want to create a new table based on the data output from the xml schema as opposed to using an existing one click on "New" when specifying the Connection Manager Settings in the ADO.NET Destination and it generate and execute the appropriate create table statement. Repeat this for any other outputs from the XML source (there will be one for each logical flat table generated from the schema).
You will most probably need to use other data transformation objects first to transform the data before it loaded into SQL server, but that is the general gist of it. If you need to run the process for a large amount of XML files you could put the task in a control loop and use a variable to set the XML file location.
The MS Documentation on using an XML source in SSIS is here: http://msdn.microsoft.com/en-us/library/ms140277(v=SQL.100).aspx
Just found XSD2DB on Sourceforge, according to the site:
XSD2DB is a command line tool written
in C#, that will read a Microsoft
ADO.NET compatible DataSet Schema File
(XSD) and generate a database.
Checking it out.

MDX retrieve recordset

I am trying to match existing reporting functionality while building up a new cube for a Proof of Concept.
Can I retrieve data from my cube using an MDX query and put it into a recordset so I can then populate an Excel Sheet with the data?
Have you considered attaching from Excel directly to Analysis Services, and using the built-in drag-and-drop query functionality? Excel will generate the MDX for you.
I've never done it, but it should be possible to integrate ADOMD.NET into a VSTO application, which will then run inside Excel. You might also be able to access some of Excel's MDX query machinery directly that way....
Best way to work with OLAP and Excel is detailed here: Simpler interface for SQL Server analysis services cubes for end users
If you want to write your own MDX instead of using drag-drop, you can't do this with Excel as far as I know. However, most languages would let you fire off some MDX at a cube, and then you could loop the recordset yourself to create a CSV file.
Or even simpler, use SQL Server's Query Analyser like this, and save the results to a CSV:
SELECT TOP 100 * FROM OPENROWSET('MSOLAP',
'Datasource=MyHotServer;Initial catalog=MyLovelyCube',
'SELECT {dimensions(0).members} ON ROWS, {time.defaultmember} ON COLUMNS FROM sales')
(N.B. If you don't know MDX yet....don't start learning unless you really have to! It isn't as easy as SQL, and you can get away without it usually.)

Resources