• Look at the example beginning with this text:

    the Report

    In order to test the report, login as a particular user or launch Internet Explorer by right clicking on it, selecting Run As, and entering the credentials to use. I have setup two accounts for my test: Tom has access to all offices and Joe is restricted to just seeing two offices.

    You'll see that when run by joe the report produces information for two offices, when run by tom it produces information for 6 offices.

    According to the article, the user-office association is defined in the table declared like this:

    CREATE TABLE [dbo].[UserOffice](

    [UserOfficeKey] [smallint] IDENTITY(1,1) NOT NULL,

    [UserAccount] [nvarchar](50) NOT NULL,

    [OfficeKey] [smallint] NOT NULL

    )

    ALTER TABLE dbo.UserOffice

    ADD CONSTRAINT pk_UserOffice

    PRIMARY KEY CLUSTERED (UserAccount, OfficeKey)

    This table allows multiple rows for each user since there's no unique constraint on the UserAccount column, so each user can be associated with multiple offices.

    Tom