SQL Server Developer Center > SQL Server Forums > Data Mining > DMX insert into data mining structure problem
Ask a questionAsk a question
 

QuestionDMX insert into data mining structure problem

  • Thursday, October 29, 2009 10:57 AMMichal Szymandera Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi!

    I have problem with inserting data to data mining structure - SQL Server 2005 SP3.
    I have Mining structure with nested table and I have Association Rules Mining Model. I try to load data to my structure by dmx query.
    I'm using sample query from the official MS page: INSERT INTO (DMX) .

    DELETE FROM MINING STRUCTURE [Association Structure];


    INSERT INTO Association
    ([Order Number],[v Assoc Seq Line Items] (SKIP, [Model])
    )
    SHAPE {
    OPENQUERY([Adventure Works DW],'SELECT OrderNumber
    FROM vAssocSeqOrders ORDER BY OrderNumber')
    } APPEND (
    {OPENQUERY([Adventure Works DW],'SELECT OrderNumber, model FROM
    dbo.vAssocSeqLineItems ORDER BY OrderNumber, Model')}
    RELATE OrderNumber to OrderNumber)
    AS [Models];

    The query pass but when I try:
    select * from Association.cases

    I get following result: DMX insert into data mining structure problem-screen.jpg

    As you can see, for every order I get the full list of products - every position is combined with every product - it's the cross join of lines and orders tables.

    Why???????

    When I'm processing my mining structure from Analysis Studio (Visual Studio - see the picture below) - everything seems ok - there isn't cross join in the select * from Association.cases query.
    DMX insert into data mining structure problem-analysis.jpg


    What is wrong with my DMX feeding query? Why I get the cross join from Management Studio (DMX) and correct result from Visual Studio?

    Thank you in advance,
    Michal, Poland