Download User Manual - Sentinel Visualizer

Transcript
,NULL) -- <ModifiedByUserId, int,>
END
PRINT @entity1
SELECT @entity2 = EntityId FROM Entity
WHERE EntityName = '0987654321'
IF @entity2 IS NULL
BEGIN
INSERT INTO [Entity]
([ClassificationLevelId], [EntityTypeId], [EntityStatusId],
[DisseminationTypeId], [InherentThreatValue], [EntityName],
[PrimaryPicture], [Brief], [StartDate], [EndDate], [UUID],
[CreatedDate], [CreatedByUserId], [ModifiedDate], [ModifiedByUserId],
[Latitude], [Longitude], [CustomStartDateId], [CustomEndDateId],
[StartTimeNull], [EndTimeNull], [CustomStartYear], [CustomEndYear],
[MiscValue])
VALUES
(20 --<ClassificationLevelId, int,>
,1016 --<EntityTypeId, int,>
,1004 --<EntityStatusId, int,>
,1005 --<DisseminationTypeId, int,>
,50 --<InherentThreatValue, int,>
,'0987654321' --<EntityName, nvarchar(450),>
,NULL --<PrimaryPicture, image,>
,'' --<Brief, ntext,>
,NULL --<StartDate, datetime,>
,NULL --<EndDate, datetime,>
,'' --<UUID, varchar(50),>
,'1/1/2012' --<CreatedDate, datetime,>
,1000 --<CreatedByUserId, int,>
,NULL --<ModifiedDate, datetime,>
,NULL --<ModifiedByUserId, int,>
,NULL --<Latitude, float,>
,NULL --<Longitude, float,>
,0 --<CustomStartDateId, int,>
,0 --<CustomEndDateId, int,>
,NULL --<StartTimeNull, bit,>
,NULL --<EndTimeNull, bit,>
,NULL --<CustomStartYear, int,>
,NULL --<CustomEndYear, int,>
,NULL) --<MiscValue, float,>
SELECT @entity2 = SCOPE_IDENTITY()
--Add to topic table
INSERT INTO [EntityTopic]
([EntityID], [TopicID], [CreatedDate], [CreatedByUserId],
[ModifiedDate], [ModifiedByUserId])
VALUES
(@entity2 --<EntityID, int,>
,1000 --,<TopicID, int,>
,'1/1/2012' --,<CreatedDate, datetime,>
,1000 --,<CreatedByUserId, int,>
,NULL --,<ModifiedDate, datetime,>
,NULL) -- <ModifiedByUserId, int,>
END
PRINT @entity2
SELECT @relationship = RelationshipId FROM Relationship
WHERE [EntityId] = @entity1 AND [RelatedEntityId] = @entity2
IF @relationship IS NULL
BEGIN
218  Chapter 19: Configuring and Maintaining Your Database
Sentinel Visualizer