Thanks
CREATE VIEW vwMyView AS
SELECT A.Acol1, A.Acol2, B.BCol1, B.Bcol2, C.CCol1, C.CCol2
FROM TableA A
JOIN TableB B ON B.BCol1 = A.BCol1
JOIN TableC C ON C.CCol1 = A.CCol1
PK that SSAS creates is:
A.Acol1, A.Acol2, B.BCol1, C.CCol1
ACol1, ACol2 is actuall PK on talbe and that what should be in SSAS.
My current workaround is to use LFFT OUTER JOIN in this case, but that
should not be like that.
Thanks
"Vimas" <Vi...@nospam.nospam> wrote in message
news:uNnxcnLh...@TK2MSFTNGP05.phx.gbl...
Based on my scope, SSAS will identiy all primary keys in the tables as the
primary key in a view. Usually there is not necessary to change this
behavior. Will you let me know why you want to change this? Since
Bcol1=Acol1=Col1, and there is no necessary to select all the columns
because they are redundent.
Based on my test, if you want to change this behavior, you could drop
primary key on tableb and tablec, and then try to remove/add the view to
the view again. You shall see the primary keys are acol1 and acol2 at this
time, and then you could add primary key again on tableb and tablec.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Thanks for your respond. Unfortunatelly, SSAS does not properly recognize
keys in my view. I have one main table and 3 lookup tables. Primary key
supposed to be just from main table. When I do INNER JOIN to lookup tables,
then logical primary key that SSAS creates is join off all keys from main
table and 3 lookup tables. That is not correct. Simply SSAS just does not
recognize keys properly.
As a workaround I join main table to lookup tables using LEFT OUTER JOIN,
then SSAS makes logical primay key as expected - keys from main table. I
have large SSAS model - about 40 measure groups. Biggest problems with
logical primary keys I have are in facts tables that have certain joins. 10
out of 40 measure groups have incorrect logical keys! I do not mind that, I
just was wondering if I could override SSAS behaviour in that part.
There is a sample script to prove my point:
CREATE TABLE a (ID1 int NOT NULL, ID2 int NOT NULL, FID1 int, FID2 int,
JustAField int NOT NULL)
go
ALTER TABLE a ADD CONSTRAINT PK_a PRIMARY KEY(ID1, ID2)
go
CREATE TABLE b (FID1 int NOT NULL, FField varchar(10) NOT NULL)
go
ALTER TABLE b ADD CONSTRAINT PK_b PRIMARY KEY(FID1)
go
CREATE VIEW x AS SELECT A.ID1, A.ID2, B.FID1, B.FField, A.JustAField
FROM a JOIN b ON B.FID1 = A.FID1
go
Now load view x into SSAS data source view. SSAS will create fields ID1, ID2
and FID1 as logical primary key on this view.
So, if you were able to reproduce this problem - how can I make SSAS choose
logical primary keys the way I want? Is this possible?
I am using SSAS 2005, 64bit, SP1.
Thanks
""privatenews"" <pet...@online.microsoft.com> wrote in message
news:9Zki3DUh...@TK2MSFTNGXA01.phx.gbl...
"Vimas" <Vi...@nospam.nospam> wrote in message
news:eOq8DpXh...@TK2MSFTNGP04.phx.gbl...
Thank you for your update. I was not able to find other workaround on this
issue at present. Please rest assured this has been routed to the proper
channel. In the meantime, I also encourage you submit your feedback on this
behavior via the link below
http://lab.msdn.microsoft.com/productfeedback/default.aspx
Best Regards,
Peter Yang
MCSE2000, MCSA, MCDBA
Microsoft Partner Online Support
Get Secure! - www.microsoft.com/security
=====================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Vimas" <Vi...@nospam.nospam>
| References: <uNnxcnLh...@TK2MSFTNGP05.phx.gbl>
<eRZ3itLh...@TK2MSFTNGP04.phx.gbl>
<9Zki3DUh...@TK2MSFTNGXA01.phx.gbl>
<eOq8DpXh...@TK2MSFTNGP04.phx.gbl>
| Subject: Re: SSAS 2005: How to I change logical primary key in data
source view
| Date: Thu, 1 Jun 2006 09:00:32 -0400
| Lines: 101
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
| X-RFC2646: Format=Flowed; Response
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
| Message-ID: <eoN1etXh...@TK2MSFTNGP04.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.olap
| NNTP-Posting-Host:
cpe001310f5a811-cm0012c90f99c6.cpe.net.cable.rogers.com 70.29.102.55
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP04.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.olap:70142
| X-Tomcat-NG: microsoft.public.sqlserver.olap
hth
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/
The workaround to this problem for now is to define a Named Query on top of the view - adding another layer of abstraction so that BIDS keeps its mittens off the Logical Primary Key for this fact table, enabling me to define it correctly (sigh).
Thanks
"Piquet" wrote:
> .
>
IE
<--unique name="Constraint1" msdata:PrimaryKey="true">
<--selector xpath=".//dbo_scv_ReportingModel" />
<--field xpath="WrongPrimaryKeyColumn" />
<--unique>
and just set the correct logical primary key