As we saw in Chapter 4, a collection is a grouping of members that isn't defined by one of the existing attributes. Creating collections is very similar to the process for creating new members. The syntax is exactly the same, other than setting the MemberType_ID
to 3
, populating the MemberName
column with the name of the collection, and populating the MemberCode
column with a unique code for the collection. The syntax for this can be seen shortly.
In this example, we are creating a new collection for stores where we want to include a marketing campaign named "2011 Campaign Targets":
/* Create a new collection in the staging tables */ USE MDS -- replace with the name of your master data repository GO /* Declare the variables for use in the insert statement */ DECLARE @ModelName nvarchar(50) DECLARE @EntityName nvarchar(50) /* Set the variables appropriately */ SET @ModelName = 'Store' SET @EntityName = 'Store' /* Insert records into the staging table. ...