.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to simulate auto-exists between dimensions

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :Sql Server

well, not really 'auto-exists'...
but, suppose for one company I have 2 dimensions amongst others in a star schema:

1. business locations
2. customers, including a user-hierarchy 'location - customer'

I often need this user-hierarchy but only for the location selected in the business location dimension. How can I narrow the user-hierarchy?
It sounds simple, but there are some pitfalls that bother me when taken all together:

a. The locationID in the customer dimension is not the key of the location in the location dimension.

b. I can't use (as far as I know) common functions like non empty, nonempty(), filter-expressions with measure=0,
because the customers are usually crossjoined with some sets like products, they *do not* have bought
- e.g. tell me the customers of my location X that have bought more than 1000 in product category A but nothing in product subcategory B2.
When I use non empty & Co then customers of all locations came up.

c. I must use the location dimension, because the cube security roles use it to show the responsible persons for one location just the customers of their location.

d. I need a parameterized mdx solution for Reporting Services 2008 reports.

Thanks in advance

View Complete Post

More Related Resource Links

BITS: Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API


Both the .NET Framework and Windows have some very interesting APIs for creating applications that are capable of updating themselves automatically over a network. There are many advantages to writing your application to update itself like Windows Update does, including convenience for your users, from easier maintenance to network administration. Automatic updates require attention to factors such as discovery, security, and file replacement. In this article, the author covers the BITS API as well as a number of features of the .NET Framework that take care of these facets of auto-updating using the same facilities that the Windows Update uses.

Jason Clark

MSDN Magazine February 2003

Making auto suggestions more appropriate for your textbox

To round out my coverage of Input Contexts we need to cover the concept of Input Classes. Put simply an input class is a hint to the Windows Mobile OS as to what kind of information should be entered into a text box (for example an email address, phone number, or person's name).

Selecting an Input Class for a textbox will change the source of data used for the auto suggestions provided by the OS as the user starts typing. For example in the screenshot above you can see the user is typing in a person's name yet the operating system is suggesting matching cellphone numbers.

auto complete extender stops


Hello everyone

when the textbox of the  autocomplete extender looses focas the auto complete extender stops the returning any results or even firing events(onpopulating, onpupulated).

Could you please help me fix this.


and I there any way to know when the extender fires the request(please provide code example if you can).


thanks a lot.

create Scheduled Task that auto send mails


hello every one

i bought a hosting plan that allows me to send about 500email/per hour

but my client wish to send about 2000 or 3000 email at a time

is there a way to split them and 500 email per a time automaticly without the need of reloging again every hour

my hosting plan doesn't allow me to create a sql jop or send mails via Sql Server.

any bright ideas ?

Checking if a URL Exists


I've got a HttpHandler which outputs XML to the client to play video, it outputs the url to the video, video name etc... Validates the request etc.

However sometimes when i upload new video the main URL doesn't pickup the file from the CDN so i have to use a different URL to go directly to one of the main servers.

For example the CDN url is:
One of the server urls is:

What i want to do is check to see if the file can be reached off the .net url before posting it back to the user.


if http://videos.****.net/ar/ar_1003_scene_1.ext response then
> post http://videos.****.net/ar/ar_1003_scene_1.ext to client
> post http://videos1.****.com/ar/ar_1003_scene_1.ext to client

I hope that makes sense.

I thought of doing a WebRequest/WebResponse but i don't want the file to come back, i just wanna know if its there or not. My site is on a single server while all the video is on a CDN.

(i can't post the url because it's NSFW)

Edit: Why do posts not auto format?!?

Linq to sql does not return appropriate multiple result sets with "If exists" conditions in the stor


Hello All,

I have a stored proc that returns 4 resultsets, they are in the format.

ALTER PROCEDURE [dbo].[pGetManagerEmployeeSummaryDummy]

    @ManagerStaffID int,
    @PeriodID int



IF EXISTS (select 1 from dbo.temployee e
    inner join dbo.temployeedetail ed
        on e.staffindividualid = ed.staffindividualid
        and ed.periodid = @PeriodID  
    inner join Incentive.tRole r
        on rm.IncentiveRoleID = r.RoleID
    where ed.ManagerIndividualStaffID = @ManagerStaffID
    AND r.RoleID = 1) --Closer
        SELECT e.StaffIndividualID, e.LastName, e.FirstName, r.RoleName, e.xname, e.yname

from dbo.temployee e

inner join dbo.temployeedetail ed
            on e.staffindividualid = ed.staffindividualid
            and ed.periodid = @PeriodID

where ed.ManagerIndividualStaffID = @ManagerStaffID

SharePoint Batch Update Auto Increment Field Value


Hello All,

I am making use of SharePoint List Batch Updating methodology in order to update the items in bulk. I build the query dynamically for each and every item using StringBuilder and process the data ultimately using 'ProcessBatchData' Method.

Now, I have a requirement where I have to increment a particular field value in the query while iterating through each item for building the query. How can I auto-increment a field value for each item in the batch query?




Hello..  I created a website in which I have an update panel being updated via a timer.  This works fine when there's only a few people online.

But now, during live testing, this bogs down the server because we have 30-60 people hitting the website and this page is being updated via the server.

Is there a way to have the page auto-update itself via javascript?  And how would I go about doing this so only a certain panel is updated instead of the full screen.


Auto Doc Edit


I want to create event handler that will edit documents (doc, docx), adds a special header to them.

Can i mess with content itself thru MOSS2007 ?

Deleting a key container. Detecting if it exists.

I have a need to detect if a key container exists. I have looked at http://msdn.microsoft.com/en-us/library/system.security.permissions.keycontainerpermission(VS.80).aspxbut I have two problems. One, the 'Deny' method appears to be obsolete. When I copy the code from this demo I get a warning that Deny is obsolete and will be removed. Two, if I follow the instructions to delete the key from the container it seems to work but if I subsequently try to get the key from the container I get another key and there is no indication that any key had been removed. Any ideas on thus manipulating key containers? Thank you. Kevin

how ssas generate sql queries when processing dimensions and partitions?

hi all, how does ssas2008 generate sql queries to read data from the source, where processing dimensions and partitions? is there any reading meterial that clearly explains how the sql queries are constructed according to properties of dsv, dimensions and measures and partitions.   thanks in advance.Andrew Chen Interested in BI related technologies

Selecting the correct auto-generated ID associated with a given customer

I have the following two tables (among many) in an OLTP database: TABLE NAME: BusinessEntity TABLE FIELDS: BusinessEntityID, int, IDENTITY(1,1), NOT NULL, PRIMARY KEY BusinessEntityType, nvarchar(10), NULL TABLE NAME: Person TABLE FIELDS: BusinessEntityID, int, NOT NULL, PRIMARY KEY, FOREIGN KEY to BusinessEntity.BusinessEntityID FirstName, nvarchar(30), NULL LastName, nvarchar(30), NULL There is a 1-to-1 Identifying Relationship between the BusinessEntity and Person tables. When a new customer needs to be added to the database, I execute the following T-SQL statement: INSERT INTO BusinessEntity (BusinessEntityType) VALUES (‘Customer’); What I don’t know how to do is retrieve the value of BusinessEntity.BusinessEntityID that was automatically assigned to the new customer so I can then append it to Person.BusinessEntityID. While I know I can execute: SELECT MAX (BusinessEntityID) FROM BusinessEntity; there is no guarantee that the BusinessEntityID will be the one associated with the new customer I just added because it is possible that other new customers can be added to the BusinessEntity table by other users during the interim period between the time I execute the previously mentioned INSERT command and then SELECT command. Any help/guidance in resolving this issue would be greatly appreciated.  Thanks.

Replication and auto Identity Increment

We want to have two SQL server working on the same data at the same time (SQL Server 2008). I've been told that the auto ID's will stop working (the identity option). I'm not sure how true this is or what is the best replication to use for this.   Thanks

[C#] Database ".mdf" already exists. Choose a different database name.

Hi all, it's all day long that i'm fighting with this problem. And i'm getting quite upset! SHORT VERSION Why when i call DataContex.CreateDatabase() does SQLExpress 2008 say that the file already exist even if the file is completly wiped form the DISK!?!   LONG VERSION So, what i'm trying to do is damn simple. I'm developing a simple web application. To do that i've built a DBML file to use with LINQ. For development purpose i'd like to create a local DB. So here my code: string connectionString = ConfigurationManager.ConnectionStrings["PermissionsDatabase"].ConnectionString; Response.Write(connectionString); using (PermissionDataContext dataContext = new PermissionDataContext(connectionString)) { if (!dataContext.DatabaseExists()) { dataContext.CreateDatabase(); } }   And in the web.config the connection strin is: Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Projects\AccessControl\WebSite\App_Data\permissions.mdf;Integrated Security=True;User Instance=True When the CreateDatabase() is called i get that Exception. Where the ____ do SQLServer keeps track of that file?! Why if the database already exists the DatabaseExists() return false?!   Moreover if i use this connection string: Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\permissions.mdf;Integrated Security=True;User Instance=True

Is there a way to check if workflow instance already exists for a particular productID in Workflow o

I am using Visual Studio 2008 and .NET 3.5. I am trying to build a WF that is exposed as WCF hosted on IIS. This service is consumed by ASP.NET client. It is a very simple WF- receive info for new product "A"- send email to person 'Xyz' that new prodcut "A" is received- do some business process for product "A"- send out more notifications for product "A"Consider this scenario - - Client hits submit on asp.net page for prodcut "A"- new WF instance is created for product "A"- client can go back to the same page, edit some more info and hit save again. However, this time or for any subsequent "Saves",  I do not want to create a new WF instance for product "A".I can check to see if a WF instance exists for product "A" on the client side before calling the service operation. However, I want to see if there is a way to do this in WF or WorkflowServiceHost, as I don't want to add this logic to client. First acitvity in WF has to be receive activity with CanCreateInstance = true, so not sure how I can do this check in WF itself.Also, I have another stupid question, when using WF exposed as WCF service, do we have to implement all service operations using WF? What if I have some service operations that just involves checking some business logic? Do I implement this in a

LinQ to check if xml node exists in the XML??

Using LinQ or any C# syntax, I just want to know whether "Item" Child exists or not if the parent Node (ChildMenuSelected>>MenuSelected) are true from the below xml format.Xml Format:<MenuDataResult> <Items> <Item> <ItemType>Submenu</ItemType> <ItemTitle>Level22</ItemTitle> <Menu> <MenuSelected>false</MenuSelected> <ChildMenuSelected>false</ChildMenuSelected> </Menu> </Item> <Item> <ItemType>Submenu</ItemType> <ItemTitle>Level21</ItemTitle> <Menu> <MenuSelected>false</MenuSelected> <!--if ChildMenuSelected = true --> <ChildMenuSelected>true</ChildMenuSelected> <Item> <ItemType>Submenu</ItemType> <ItemSubType>0</ItemSubType> <Menu> <!--if MenuSelected = true --> <MenuSelected>true</MenuSelected> <ChildMenuSelected>false</ChildMenuSelected> <!-- whether this below item exists or not --> <Item> <ItemType>Submenu</ItemType> <Menu> <MenuSelected>false</MenuSelected> <ChildMenuSelected
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend