Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Create a simple table to hold data.
- CREATE TABLE [dbo].[Sales](
- [OrderId] INT PRIMARY KEY,
- [Product] NVARCHAR(50) NULL,
- [Qty] INT NULL,
- [GroupId] INT NULL
- )
- GO
- --Create a simple data to hold User/Group relations.
- CREATE TABLE [dbo].[GroupUsers](
- [GroupId] [int] NULL,
- [GroupName] NVARCHAR(50) NULL,
- [MemberFQN] NVARCHAR(448) NULL,
- )
- GO
- -- Inserting users and groups
- INSERT [dbo].[GroupUsers] VALUES
- (1, N'Group 1', N'K2:DENALLIX\Bob'),
- (2, N'Group 2', N'K2:DENALLIX\Jonno'),
- (3, N'Group 3', N'K2:DENALLIX\Markus')
- GO
- -- Inserting some Sales Values
- INSERT [dbo].[Sales] VALUES
- (1, N'Product 1', 15, 1),
- (2, N'Product 2', 10, 1),
- (3, N'Product 3', 10, 2),
- (4, N'Product 4', 15, 2),
- (5, N'Product 5', 10, 3),
- (6, N'Product 6', 10, 3),
- GO
Add Comment
Please, Sign In to add comment