SQL Server 2014 :: How To Check Existing Attribute In Insert Attribute In XML Field

Aug 10, 2015

I want to insert attibute att1 in field F1 . Value for this attribute is content of another field in this table (F2).

My query :
update MyTable
set F1.modify
('insert attribute att1 {sql:column("F2")} into (/ROOT/Node1)[1]')
Where F1 Is not null

But I get this error :
XML well-formedness check: Duplicate attribute 'att1'. Rewrite your XQuery so it returns well-formed XML.

How do I check the douplicate attribute ?

View 0 Replies


ADVERTISEMENT

Measure Group Attribute Key Column Does Not Match Source Attribute

May 16, 2008



HI,


I had to change the key columns of a dimension attribute to fix an error. I did this in BIDS. The change was from a single key column to a composite key column. Now I am getting these error when I process the cube:

Measure group attribute key column x does not match source attribute ..

I looked at the cube XMLA definition under mesaure groups and it still shows a single key column with inherited binding. However, the BIDS does not give me an option correct this in any way. I have had to do this once before and the only option seems to be removing the dimension from the cube and add it back in. But that is very error prone since I lose any specific settings at the cube dimension level not to mention aggregations no longer include the dimension, etc.

Not seeing an alternative, I went through each measure group (I have 7) and changed the key columns manually in the XMLA and saved the cube. This worked, but I don't understand why BIDS automatically doesn't do it.

Is this a flaw in the BIDS or I should be missing something.

thanks
MJ

View 3 Replies View Related

Field Attribute Question

Jan 25, 2005

If I want to store day of the week (i.e. Mon), do I use datetime field or char? Also if I update #25/12/2004# to a datetime field. What is the value is the time port of the field? Thx.

View 10 Replies View Related

How To Define Field Attribute For A Numeric Field In SQL Table?

Jan 19, 2005

I need create a field to store tax rate. I need only 2 decimal points. I defined the field as decimal, precision=5 and scale=2. Does it mean that it can hold value from 0.00 to 999.99?

View 12 Replies View Related

Update XML-source Attribute With Database Field Value?

Nov 27, 2006

Hi! A question just struck me that I cannot test right now (don´t have vs2005 on this computer)...Is it possible to add a database-field value to an Xml-Source object attribute?

For instance <Object id=1 name="void" description="" /> is my souce xml...  in this case I want to replace the description attribute value (string.Empty)  with a value from my db...  can this be done?

Regards
Erik B.

 

View 1 Replies View Related

Analysis :: Data Masking For Dimension Attribute Based On User In SSAS 2014 Multidimensional?

Jun 15, 2015

I am trying to implement data masking based on user login and not sure why this is not working. I have the dimensions DimBrand, DimProduct and DimUser. I should mask the BrandCode with 'XXXX' nothing but in the report all the BrandCode should appear but few of the code will be masked if the user is not belongs to that group. I have a fact table FactProduct in this. In the cube I created all these 3 dimensions and the fact table. I created a new dimension DimBrandMask and I separated the code over there with a relationship with the actual DimBrand dimension. In the cube a reference relationship is set up with the measure group. Created a role with read access.

In the dimension data tab of role I put the below MDX to allowed set.

NonEmpty([DimBrandMask].[Brand Code].Members, (StrToMember("[DimUser].[Login Name].[Login Name].[" + UserName() + "]") ,[Measures].[Dim User Count]))

And in Denied Member set i put the below MDX

IIF( (StrToMember("[DimUser].[Login Name].[Login Name].[" + UserName() + "]"), [DimUser].[Access Right].&[False]), NONEMPTY( [DimBrandMask].[Brand Code].Members,(StrToMember("[DimUser].[Login Name].[Login Name].["
+ UserName() + "]"), [DimUser].[Access Right].&[False], [Measures].[Dim User Count])),{})

Note I created one measure group from the DimUser table and the measure [Dim User Count] is used in the above query.

I am expecting some result like below

Brand      BrandCode           Count
Brand1      b1                       6
Brand2     XXXXX                  5
Brand3     XXXXX                 10

View 9 Replies View Related

Declaring A Composite Attribute In Sql Server

Mar 28, 2008

hi guys i have a question ..... i would like to know how to delare a compound attribute in this case would be Birthinfo onto a sql server script. from this diagram . thanyou guyt in advance and any suggestion or help would be greatly appreciated .....

View 10 Replies View Related

Select Into / Linked Server / Missing IDENTITY Attribute

Nov 28, 2005

Greetings,If I use a "select into" to clone a table, all attributes are createdcorrectly, however, if I use the same statement across a linked server,my identity column loses its IDENTITY specification.Is this a known issue or basic functionality of using "select into"with linked servers?Kurt

View 2 Replies View Related

The Value Of The PublicKey Attribute In SQL Server 2005 Express Edition

Dec 7, 2007

Hi all

I make a Prerequisites Setup to my application to install SQL Server 2005 Express.

I found that the included file (C:Program FilesMicrosoft Visual Studio 8SDKv2.0BootStrapperPackagesSqlExpressenSQLEXPR32.EXE) version is 9.0.1399.6
there is an xml file with the name package.xml which contain a PublicKey


<PackageFile Name="sqlexpr32.exe" HomeSite="SqlExprExe" PublicKey="3082010A0282010100CF38F7E1A4275EF8F0CCAACEFB3ADE3B6231460546BBF5B6051AD3B3ACC29F0F4C670828C44310F53B75797F6A91F4D633C861BFFA9190007AF0791D5D6870F690B29877B5031D2F9B9D9B75892F4A01417C9E7CCB87439BF49674999E98C1CF40575816F6C0D59216E52485718F9949ED557C65C91F380023C53EAB11D6296CC69EA0705B7DD537D4677720C306CE85F84E3480A035C41C53320157EFB128BD6C01E3AD40BC80A90949DB36E337F41D49AA2AA76BD019D3CC8E9DD686467A134AD64519A553B3E2782F2E35976B4CC6E81AB0D3D1249069ABCEFC696E3E4CFB024162DC07985D7E5CA74C27316B564CE198D8E0D11D718D3D2AC07F714DFFCF0203010001" />
<PackageFile Name="eula.txt" />
</PackageFiles>



later I download a new version 9.0.3042.0. from internet

then I replace the the old file with the new one and after rebuilding Prerequisites Setup, I got this error

Prerequisites Setup
Warning 1 The value of the 'PublicKey' attribute in 'SQL Server 2005 Express Edition' does not match that of file 'C:Program FilesMicrosoft Visual Studio 8SDKv2.0BootstrapperPackagesSqlExpressensqlexpr32.exe'. C: estingPrerequisites SetupPrerequisites Setup.vdproj Prerequisites Setup

When I install my application, Prerequisites fail to install

How can I got out from this bug and keep the new version ??



Khayralla

View 3 Replies View Related

DirectReports-- How To Extract This Active Directory Attribute Value In MS SQL 2000 Server

Nov 22, 2007

hi,
I am trying to run a query analyzer via query against ad. Below is the error I am getting. How to extract the directReports attribute values from windows 2003 active directory


SELECT * FROM OPENQUERY( ADSI,
'SELECT directReports FROM ''LDAP://192.168.1.24/dc=xxx,dc=com''
WHERE objectCategory = ''Person'' AND objectClass = ''user'' order by name')

Err: Server: Msg 7346, Level 16, State 2, Line 1
Could not get the data of the row from the OLE DB provider 'ADsDSOObject'. Could not convert the data value due
to reasons other than sign mismatch or overflow.

plz do the need full

thanks & regards
venkey

View 3 Replies View Related

Auto Incrent Attribute SQL Server 2000 Vs Sql Server 2005

May 14, 2007

In our application we use the ADODB.Recordset.



In SQL server 2000



If there was a view that joined 2 tables and I accessed the view the 2 ID fields in the view would still have the AutoIncrement attribute still set to true so that I knew those were Identity fields.



In SQL server 2005

I dont' know why but if you reference a View that has Identiy AutoInc fields in ADO it doesn't keep those properties.



Also for whatever reason we Set the ID field to 0 to let ourselves know its a new Record. SQL 2000 let it happen and assumed it to be null where as By Setting the ID to 0 in SQL 2005 causes it to blow up on me.



Is there some sort of setting in SQL that can make SQL 2005 work like SQL 2000 in these two instances...

View 1 Replies View Related

NOCASE Attribute

Jun 25, 2004

Does someone could explain me the NOCASE attribute in the order by line?

I cant find that anywhere.

Thanks a lot,
venusgirrl

View 4 Replies View Related

Attribute Key Cannot Be Found !

Jun 3, 2007

Hello !

Can somebody help me with the following error while deploying my cube:

The attribute key cannot be found : dbo_fact_table, Column: datetime Value 25/10/1901 4:18:00 pm...

The year 1901 is included in the time period of the time dimension.
The calendar includes the following dates :
1/1/1753 - 31/12/2007 (Time binding)
Why this referential integrity error occurs ??

Please help me because it is urgent and I cannot find a solution..

Thanks

View 1 Replies View Related

Nullable Attribute

Sep 10, 2007

What happens if a column which has been defined so that it should not be Nullable is passed a value which is null?

i.e. IDNumber - Primary Key and Nullable = No.

Thanks

View 3 Replies View Related

DropDownList Attribute ????

Dec 11, 2007

can someone please tell me if you can implement a drop down list within a table attribute.

If anyone could show me an example please do.


Kind Regards

Rob

View 11 Replies View Related

MAC Address Attribute

Aug 10, 2005

Hi:I need to store MAC Addresses. What is the standard way of storing thistype of attribute? Datatype? I can't find any discussions about thisanywhere.Thx for any pointers.

View 1 Replies View Related

Selecting N-th Attribute

Jul 20, 2005

Hi!I have a following problem: I need to select some attributes fromtable, i.e.first, third, fifth...Can anyone give me the hint how to do it. Is there some method to saysomthing like this:SELECT $1, $3, $5 which will refer to the 1st, 3rd and 5th attribute?Thanks!Mario.

View 5 Replies View Related

Using T-SQL REPLACE (or XML) To Add An Attribute To Every Other &&<td&&> Tag

Jan 10, 2008

I have the following as part of a stored procedure that generates an HTML report based on the data inserted into the table variable "@tblTemp":


SET @html =

N'<table border="1" width="0" style="font-family: Verdana, sans-serif;">' +

N'<tr><th>Name></th><th>ID</th></tr>' +

N'<col align="left"></col><col align="right"></col>' +

CAST ( ( SELECT td = [Name], '',

td = IDNumber

FROM @tblTemp

ORDER BY ID

FOR XML PATH('tr'), TYPE

) AS NVARCHAR(MAX) ) +

N'</table>' ;

SET @html = @html + N'<br /><br /><img src="muuscreenshot.jpg" width="452" height="507" alt="sample.aspx" />'

This generates a 2 column table that later in the stored procedure is sent out via sp_send_dbmail. The problem I'm having is that I want the right (2nd) column of the table to be right-aligned. For some reason, the line "

N'<col align="left"></col><col align="right"></col>' +" doesn't right-align the 2nd column when the report is sent through email (althought it does work if I take the generated string a use it to manually create an HTML file). So I want to add something like:

SET @html = REPLACE(@html, '<td', '<td align="right"')


but I still want the left column to be left-aligned, and this right-aligns everything. Is it possible for me to use REPLACE (or some other string function) to replace every other (alternating) "<td", or should I be looking at parsing this string using some 2005 XML features (unfortunately, using a CLR function to do this is not an option, since I am not allowed to turn that on on the server I'm using)? Thanks in advance.

-Dave

View 7 Replies View Related

Forced_Regressor Attribute

Jan 9, 2008



I am trying to create a linear regression model. The model is skipping lot of columns for regression. But I want model to use all the columns even if they are not valid. I use Forced_Regressor attribute while creating the model.

add mining model Regressiontableinput2_Model
(

[id] ,

[Reading] PREDICT_ONLY,

[Const] regressor,

[HCDD] regressor,

[HHDD] regressor,

[Hr1] regressor,

[Hr2] regressor,

[Hr3] regressor,
) USING MICROSOFT_LINEAR_REGRESSION (FORCED_REGRESSOR=1)



I get the error

Error (Data mining): The 'FORCED_REGRESSOR' data mining parameter is not valid for the 'Regressiontableinput2_Model' model.

Can somedbody tell me what is the syntax for using FORCED_REGRESSOR

Thanks,
DMNovice

View 4 Replies View Related

SQL XML :: Access Attribute Value

Jun 30, 2015

I am trying to generate an output using Productname from below xml which will look like:

B/C/
B/D/E
demo xml:
DECLARE @myDoc xml
DECLARE @ProdID nvarchar(10)
SET @myDoc = '<Root>
<ProductDescription Productname="A" Productd="Road Bike">

[code]...

I have a query which works perfect but  with nodes. similar way I am looking for the value column. I want a similar result from the function on "Value" column(value column is defined inside the below query) : B/D/E ....

with
CTE_xpath as (
select
T.C.value('local-name(.)', 'nvarchar(max)') as Name,
T.C.query('./*') as elements,
T.C.value('text()[1]', 'nvarchar(max)') as Value

[code]...

View 13 Replies View Related

Derived Attribute

Oct 11, 2007



i have a column in my table that will store the sum of 3 other column, e.g the data in total_book column will be equal to the sum of the number in the romance, fiction and thriller column. how do i do this?

View 1 Replies View Related

Selecting XML Attribute

Mar 10, 2008

I am trying to retrive some values from and XML data colum , along with that i need other normal column data also . how can i do that ?

here is my problem


I have a table with 2 colum .

Column Data Type
ID Int
Data XML


The XML data looks like following

<A>
<B a = 'sun' b = 'Red' >
</B>
<A>


I want to get each id and the 'b' attribute of the B node of the xml data for each row ?

Please help me if there is any simple way to do this .

View 5 Replies View Related

More Than One Attribute As A Primary Key

Jan 21, 2008

Hi everyone,
I heard that it is possible to make more than one attribute(coloumn) primary key. Is this really possible, logical, productive and beneficial ?

Thanks

View 4 Replies View Related

How Can I Set An Attribute Of Unsigned Zerofill In SQL?

Aug 6, 2007

 How can I set an attribute of unsigned zerofill in SQL? Like for example, there is an option in MySQL phpmyadmin to set the attribute of a specific column to unsigned zerofill, it will be based on the length of the integer. For example, the lenght of my int is 5, so if i'll set the attribute of the column to unsigned zerofill, the value that will be auto incremented will have zeroes before that actual value, for example000010000200003....00010and so on and so forth...But, how can i do this in SQL? I'm using MS SQL Server Management Studio Express, but I can't find the field attributes to set it to unsigned zerofill.. I hope somebody will reply in this post.. :( 

View 5 Replies View Related

Problem With The Attribute Attachdbfile

Jan 6, 2008

Hi,I actualy have a problem with the connection to the databasefile that is stored within the websitetree by visual webdeveloper.I'm told that  the attribute AttachDbFile  is not understood. How have I to define which database (.mdf-file) should be taken that contains thetables that are needed in the later processing.Here the actual code:Imports Microsoft.VisualBasicImports SystemImports System.DataImports system.Data.SqlClientImports System.WebImports System.XmlPartial Class admin_news    Inherits System.Web.UI.Page    Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles DetailsView1.DataBound        If DetailsView1.CurrentMode = DetailsViewMode.Insert Then            DirectCast(DetailsView1.FindControl("datumTextbox"), TextBox).Text = Now        End If        If DetailsView1.CurrentMode = DetailsViewMode.Edit Then            DirectCast(DetailsView1.FindControl("datumTextbox"), TextBox).Text = Now        End If    End Sub    'Prozedur wird bei Update ausgeführt    Public Sub DetailsView1_Update(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceCommandEventArgs)        Dim conn As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFile=C:Pferdeservice KarleApp_dataPferde.mdf;Integrated Security=True Connection Timeout=30;User Instance=True")        conn.Open()        Dim cmd As New SqlCommand()        Dim cmd1 As New SqlCommand()        cmd.Connection = conn        Dim sqlUpdate As String        Dim sqlUpdate1 As String        sqlUpdate = "UPDATE News_Kultur set Header = "        sqlUpdate &= DirectCast(DetailsView1.FindControl("Headers"), TextBox).Text        sqlUpdate &= "Ueberschrift_D ="        sqlUpdate &= DirectCast(DetailsView1.FindControl("Ueberschrift_D"), TextBox).Text        sqlUpdate &= "Ueberschrift_E ="        sqlUpdate &= DirectCast(DetailsView1.FindControl("Ueberschrift_E"), TextBox).Text        sqlUpdate &= "Text_D"        sqlUpdate &= DirectCast(DetailsView1.FindControl("Text_D"), TextBox).Text        sqlUpdate &= "Text_E"        sqlUpdate &= DirectCast(DetailsView1.FindControl("Text_E"), TextBox).Text        sqlUpdate &= "WHERE (((News_Kultur.ID)="        sqlUpdate &= DirectCast(DetailsView1.FindControl("ArtikelID"), TextBox).Text        cmd.CommandText = sqlUpdate        sqlUpdate1 = "UPDATE News set Datum="        sqlUpdate1 &= DirectCast(DetailsView1.FindControl("datumTextbox"), TextBox).Text        sqlUpdate1 &= "WHERE ID="        sqlUpdate1 &= DirectCast(DetailsView1.FindControl("NewsID"), TextBox).Text        cmd.CommandType = CommandType.Text        cmd1.CommandType = CommandType.Text        cmd.ExecuteNonQuery()        cmd1.ExecuteNonQuery()        conn.Close()    End SubEnd Class  

View 1 Replies View Related

Attribute Value In A Print Statement

May 2, 2008

Hey i have written a constraint trigger that will return an error message, but i want to include values from a count in the error msg. i know how it would be doing in oracle

RaisError('You cannot add more then' ||Bedroom_Count|| 'student tenants into this house', 10, 1)

how do i achieve the same result in MS SERVER

regards

QUISH

View 1 Replies View Related

Derived Attribute Column

Apr 4, 2007

Hello, first time here, first time messing with SQL.

When creating a table in SQLServer2005 can you specify a column to be for a derived attribute. example a column monthlysalary and create a column that is a derived attribute - yearly salary. Is this done when creating the table and how is the syntax ?

View 7 Replies View Related

Representation For Heterogeneous Attribute Set

Jul 23, 2005

My company is working on a bond derivative portfolio analysis tool andwe're facing a problem that I did not see adequately addressed anywhere in literature. I really did RTFM. I'm very experienced inrelational modelling (10+ years) so this is not a case of notunderstanding the principles. Here is the problem stripped ofirrelevant context. The problem below is simplified for the sake of theexample so don't sweat the details.THE PROBLEM1. There are many types of bonds, each type has a different set ofattributes, different attribute names, different attribute datatypes.For example, bond A has two variables: a yearly interest rate anddate of issue, B has five variables: an interest rate and 4 specificdates on which various portions of principal need to be paid, bond Chas a set of 4 variables: interest rate in period 1, interest rate inperiod 2, the date on which the bond can be put back to the issuer,and two dates on which the bond can be called by the issue. And so on.So, on the first attempt I could represent each bond type as its owntable. For example,create table bond_type_a (rate INTEGER, issue_date DATE)create table bond_type_b (rate INTEGER, principle_date1 DATE,principle_date2 DATE, principle_date3 DATE, principle_date4 DATE)create table bond_type_c (rate1 INTEGER, rate2 INTEGER, put_date DATE,call_date DATE)This is the nice relational approach but it does not work because:2. There are many thousands of bond types thus we would have to havemany thousands of tables which is bad.3. The client needs to be able construct the bond types on the flythrough the UI and add it to the system. Obviously, it would be bad ifeach new type of bond created in the UI resulted in a new table.4. When a user loads the bond portfolio it needs to be very fast. Inthe table per type approach if a user has a 100 different types if bondin the portfolio you would have to do 100 joins. This is a heavilymulti user environment so it's a non-starter. It's impossibly slow.THE SOLUTIONSSo now that we ditched the table per bond type approach we can considerthe followiing solutions (unpleasant from the relational point ofview):1. Name-Value pairs.create table bonds (bond_id INTEGER, bond_type INTEGER, attribute_idINTEGER, value VARCHAR(255))Comment: The client does not like this approach because they want torun various kinds of reports and thus they doe not want the values tobe stored as VARCHAR. They want the DB to enforce the datatype.2. Typed Name-Value pairs.create table bonds (bond_id INTEGER, bond_type INTEGER, attribute_idINTEGER, int_val INTEGER, string_val VARCHAR(255), date_val DATE_Comment: The client does not like this because the table is sparse.Every row has two empty fields.3. Link table with table per data type.create table bonds (bond_id INTEGER)create table bond_int_data (bond_id INTEGER REFERENCES bonds(bond_id),value INTEGER)create table bond_string_data (bond_id INTEGER REFERENCESbonds(bond_id), value VARCHAR(255))create table bond_date_data (bond_id INTEGER REFERENCES bonds(bond_id),value DATE)Comment: This meets most of the requirements but it just looks ugly.4. Dynamic Mappingcreate table (bond_id INTEGER, int_val1 INTEGER, int_val2 INTEGER,date_val1 DATE, date_val2 DATE, string_val1 VARCHAR(255), string_val2VARCHAR(255))Then you have to add some dynamic mapping in your code which willprovide bond specific mapping (say, stored in an XML file). Forexample,For bond_A: yearly_rate maps to int_val1, issue_date maps to date_val1For bond_C: rate1 maps to int_val1, rate2 maps to int_val2, put_datemaps to date_val1, call_date maps to date_val2)Comment: This is very good for performance because when I load aportfolio of different bond types I can pull them all in in one SELECTstatement. However this approach has a problem that the table issparse. The number of fields of each type has to be as high as toaccmodate the most complex bond while simple bonds will only be usingtwo or three.THE QUESTIONS:Are the four approaches I described above exhaustive? Are there anyother that I overlooked?

View 12 Replies View Related

Get Dicision Tree Attribute Name Using VB.net

Jul 10, 2007

Hello All,



I am going through the Data Mining Web Control sample and have that working beautifully. I now want to add in some more functionality by allowing the end user to select the: database, model and tree to view in the web viewer (similar to the parameters in SSRS). I am trying to figure out a way to get all this data programatically. So far this is what I have:




Code Snippet

For Each newDB As Microsoft.AnalysisServices.Database In myserver.Databases

dbName = newDB.Name.ToString

myLog.AppendText("DATABASE NAME - " + dbName + vbCrLf)

For Each newStructure As Microsoft.AnalysisServices.MiningStructure In newDB.MiningStructures

structureName = newStructure.Name.ToString

myLog.AppendText(" STRUCTURE NAME [ " + structureName + " ]" + vbCrLf)

For Each newModel As Microsoft.AnalysisServices.MiningModel In newStructure.MiningModels

modelName = newModel.ToString

modelAlgorithm = newModel.Algorithm.ToString

myLog.AppendText(" MODEL NAME -" + modelName + " " + modelAlgorithm + vbCrLf)



This works beautifully but I am having a problem getting the tree name which i believe its called the "attribute_name".



I can run the following SQL against Analysis Services and get the attribute name but I would like to get all this programatically and insert into a table.




Code Snippet

SELECT attribute_name

FROM [model].content

WHERE node_type=2



I plan to run this daily and update a table. This will ultimately let me pull the structure into my data mining viewer page. This way, I will only have to have one viewer page for all models, instead of a new page for each.



Thanks,

Cam

View 3 Replies View Related

Retrieve Value Of The Root Attribute In XML

Apr 2, 2008

Hello everyone,

I have an xml file that looks like this:

?xml version="1.0" encoding="UTF-8"?>

<WHOLE Date="*********">
<MAIN .......</MAIN>
</WHOLE>

What i need is to find a way to retrieve the value of the attribute belonging to the root element (value of @Date) in SSIS.
Tried it using Xpath but don't know how i should configure the xml task editor or if maybe there's any other way to perform such a task.

thank you

View 6 Replies View Related

SQL XML :: Options For Attribute Generation?

Nov 19, 2015

options for attribute generation. The query:

select 'Delivery' as "@DeliverableName"
,'Path'    as "@TargetDirectoryPath"
for xml path('Deliverable'), type
generates the following:
<Deliverable DeliverableName="Delivery" TargetDirectoryPath="Path" />

We are interfacing to a third party package that only accepts single quoted attributes:

<Deliverable DeliverableName='Delivery' TargetDirectoryPath='Path' />

Is there an option which will control the enclosing quotes?

View 3 Replies View Related

Attribute Search In A Database

Aug 17, 2007

Hi guys,

I'm trying to find some attributes within a database I'm working with. I'm working with SQL Server 2000, and I'm trying to find table which have a certain attribute in them. for example, If I want to see tables from my database which have an attribute called 'home_address', what would the query be? Or is there an inbuilt function in SQL Server 2000 which allows me to search this?

Thank you!


View 4 Replies View Related

Analysis :: How To Get Dimension Key Attribute In MDX

Apr 30, 2015

Many dimensions don't have unique members.  Instead, the dimension source data has duplicates at the leaf level: it's left up to SSAS to aggregate up to the actual leaf level used in hierarchies.

Every cube I've worked on in the past, a dimension is clearly defined in the source data, with uniqueness already present there: we don't make a dimension out of duplicated, sort of facty data.  This kind of design seems as weird to me as an unnormalised SQL database.

Here's an example to illustrate what I mean; I'll use that Adventureworks database.

We have a Geography dimension with a Geography hierarchy.  Levels go like this from top to bottom:

Country
State-Province
City
Postcode

The Geography dimension has a key attribute called Geography Key.  It's there in the cube design as a dimension attribute, but it's not in any of the hierarchies, so I can't query it in MDX.  But that's fine: it has the same cardinality as the lowest level (Postal Code), because the dimension has some kind of normal design.

In the cube I'm dealing with, it's all messed up.  Using the AdventureWorks example above as a parallel, someone made a Geography dimension with source data keyed on [PostalCode, ExactAddress], but only wanted the dimension granularity to be PostalCode.

This makes it very hard to debug why the data in this dimension is incorrect.  I can't match up the dimension members in the cube to the source data, because the dimension doesn't actually go down to the real leaf level!

So I have a dimension attribute called ExactAddressKey, but I can't query on it in MDX, because it's not part of any dimension hierarchy.  Unfortunately changing any part of this cube design is not possible, so I can't even experiment with settings and see what happens.

How I could get to the leaf level of the data imported?  Something like

Geography.Geography.TheInvisibleLeafLevel.Members.Properties('Key')

Or does this kind of dimension design result in SSAS discarding all the data that's more granular than the most granular attribute defined in any hierarchy - so that the data actually isn't there to be queried?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved