Showing posts with label address. Show all posts
Showing posts with label address. Show all posts

Wednesday, March 28, 2012

how to assign the view to a user?

im using the Northwind database, i use T-SQL commands to create a view that restricts users from seeing the address, city for all employees.
i dont know how to assign the view to a user in the database using Enterprise manager.
pls help me, im really needing a answer.
thanks!

What do you mean by assign a view to a user, do you just want to grant him Select permissions on the view, or do you want the user to be the owner of the view ?

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||i want the user to be the owner of the view
pls, step by step.
thanks.|||

sp_changeobjectOwner 'dbo.MyTable', 'Scott' -- this will grant ownership of the object to a user named 'Scott'

Check out my SQL Server 2005 Video Tutorials: http://www.learnsqlserver.com/

|||But you should be aware that sp_changeobjectowner is for SQL 2000 only. It is still existing for SQL 2k5 but should not be used anymore in SQL2k5. Use the other options mentioned in the BOL (look in the entry sp_changeobjectowner)

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Wednesday, March 21, 2012

How to address cells in a calculation

I have a calculation where I need to get the value of a certain cell in my cube. It looks like this:

([Measures].[Amount],

[Table].[Table].&[{327365F8-F148-4C34-A749-D3F56FD3B8F6}],

[Line].[Line].&[{2155F898-47EA-4269-B167-BE940C79E9F6}],

[Column].[Column].&[{83435F85-93AB-48D1-B2F3-B5E0BAF62642}],

[Currency].[Currency].&[{2FA606E1-0A20-4A21-B360-643A530C297B}],

[Maturity].[Maturity].&[{188601ED-2E02-4883-9336-45BC831C5EE8}],

[Region].[Region].&[{0712BAAF-FEE4-479E-8287-E75DAD405B40}],

[Sector].[Sector].&[{E52C493D-6528-490E-BD63-4A0857F8B53F}],

[PastDue].[PastDue].&[{524942A0-A1ED-4BF5-86D2-F8EF393F0004}],

[Custom].[Custom].&[{7FCAB9D1-4D7B-48CD-8EEC-1AA47F5D9CD1}],

[Situation].[Situation].&[{7187DCEE-11C9-4EC2-A2CB-BC2534716D8B}])

The problem here are the uniqueidentifiers or as you like the ID's of the members. Is there another way to select a certain cell in my cube by using other properties of the members ? I would prefer something like

(

[Measures].[Amount],

[Table].[Table].&["First Table"],

[Line].[Line].&["First Line"],

[Column].[Column].&["First Column"],

[Currency].[Currency].&["EUR"],

[Maturity].[Maturity].&["TotalMaturity"],

[Region].[Region].&["TotalRegion"],

[Sector].[Sector].&["TotalSector"],

[PastDue].[PastDue].&["TotalPastDue"],

[Custom].[Custom].&["TotalCustom"],

[Situation].[Situation].&["TotalSituation"]

)

When referencing a member you can use the "Key" value or the "Name" value. In your example:

This referes to a "Key" value

[Currency].[Currency].&[{2FA606E1-0A20-4A21-B360-643A530C297B}],

You can refer to the "Name" value using:

[Currency].[Currency].[EUR],

Notice that the "&" symbol is removed when referencing a member name.

HTH,

- Steve

|||

Absolutely.

You can use names instead of the keys.
In the simpliest case you just to drop the "&" character and make sure you provide a full path to your member.

In form of :

[Dimension].[Hierarchy].[Level].[Member]

For instance ; [Product].[Products].[Product Family].[Drink]

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Thank you both for your answer.

I have a dimension where multiple members have the same name ... how can I address these ?

thanx in advance

|||

Answer is that it depends.

If you have two members with the same parent then:

[Dimension].[Hierarchy].[Parent Level Name].[Parent Member Name].[Member Name]

will return the value for the first member matching the "Member Name"

If the two members have different parents then:

[Dimension].[Hierarchy].[Parent Level Name].[Parent Member Name 1].[Member Name]

[Dimension].[Hierarchy].[Parent Level Name].[Parent Member Name 2].[Member Name]

can be used to reference each member individually.

HTH,

Steve