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
536 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 37

Expert Comment

by:TommySzalapski
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
It didnt really answer my question of why you cant use a query, but thats ok.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating and Managing Databases with phpMyAdmin in cPanel.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now