Solved

Sql Server 2008: Data Mining Project in BIDS: Why cant data source views be based on a query?

Posted on 2011-03-17
8
538 Views
Last Modified: 2013-11-15
Hi,

I've created an analysis services project in BIDS with the intention of creating a mining strucuture. I notice that you cannot create a data source view based on a query and that it must be based on linking actual tables (via the access looking GUI).  In my scenario I have a very long and complicated query which uses temp tables to retreive the data I want to use for mining.   Am I forced to insert this data into a table in order to create and use a mining structure?  Or are there other ways to do it?
0
Comment
Question by:BostonMA
  • 4
  • 4
8 Comments
 
LVL 37

Accepted Solution

by:
TommySzalapski earned 500 total points
ID: 35158614
If you have SQL Server 2008, then you can use SQL Server Management Studio to create a view based on a query. I've never used BIDS, so I don't know if you can do it directly in there, but I don't see why it wouldn't be better to put the view in SQL Server. That's the way we do it for all our data mining.
0
 
LVL 4

Author Comment

by:BostonMA
ID: 35158865
Convincing our DBA that adding huge analytical queries as views in the database is going to be a difficult sell.
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 35158982
Why? You could set it to only update the view on demand and it would be the same as running the view from BIDS as far as performance goes wouldn't it?

Anyway, I've had a similar issue with Excel, but if I create the view and then hit 'Edit Query' I can actually manually edit the query and put whatever I want in there. I assume BIDS has a similar capability. I'll look around and see if I can find it, or maybe someone else will chime in who already knows.
0
 
LVL 4

Author Comment

by:BostonMA
ID: 35159877
The analytical query is based on temp tables.  When I try to create a view based on sql with temp tables I get the following message:

Views or functions are not allowed on temporary tables. Table names that begin with '#' denote temporary tables.

Also regarding your suggesteion that similar to excel, you can 'edit query'.  That same functionality exists in BIDS, but it wont take sql with temp tables create statements.

So it looks like I'm back to having to create a table for this data, unless i rewrite the query not to use temp tables. Any  other ideas?
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 37

Expert Comment

by:TommySzalapski
ID: 35160070
Oh, that makes more sense. If my following comments make no sense, then I might not understand yet exactly what you are trying to do.
When I try to create a view based on sql with temp tables
Instead of using temp tables, why not use nested select statements in the query. Just make one big SQL friendly query for your view that doesn't require using the # temp table things.
You can do SQL like
SELECT Table2.x,Table2.y,Table2.z
FROM (SELECT Table1.a,Table1.b,Table1.c FROM Table1) Table2
So you can avoid the special temp tables and just make one big SQL query.

When I try to create a view
I thought your DBA didn't want this view in there. Or is this a view in BIDS. If so (and the above doesn't work), can't you make other views in BIDS instead of temp tables?
0
 
LVL 4

Author Comment

by:BostonMA
ID: 35160244
Because of the size of our database, using temp tables is necessary. When I've tried only using derived tables (you call them nested select statements) in the past,  the query never returns results.  Sometimes using a temp table is required for the analysis.

The DBA doesnt want the views in the production system.  I'm in a development enviroment.  You cant create a view in your BIDS project, you can only use whats on the server, which is the gist of this question. It appears you can only use views and tables to base your data mining data source from which seems very weird.  
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 35162726
I don't see why derived tables should be any different then temp tables in functionality. There are tons of excellent SQL query writers on this site (I'm pretty good, but there are many better). It's almost a guarantee that we/they could help you get it working with derived tables.
0
 
LVL 4

Author Closing Comment

by:BostonMA
ID: 35300365
It didnt really answer my question of why you cant use a query, but thats ok.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now