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
552 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

707 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