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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
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…

809 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