Created
August 1, 2018 05:15
-
-
Save jibinpb/d493230b386ee98df614fd749816fbef to your computer and use it in GitHub Desktop.
SQL Server GDB - Create Node And Edge Tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF OBJECT_ID('dbo.Entity', 'U') IS NOT NULL | |
DROP TABLE dbo.Entity | |
GO | |
-- Create Entity as NODE table | |
CREATE TABLE dbo.Entity | |
( | |
[ID] INTEGER PRIMARY KEY IDENTITY, | |
[Name] VARCHAR(100) NOT NULL, | |
[Code] VARCHAR(100) NULL, | |
[Type] VARCHAR(100) NOT NULL | |
) | |
AS NODE | |
GO | |
IF OBJECT_ID('dbo.Subsidiaries', 'U') IS NOT NULL | |
DROP TABLE dbo.Subsidiaries | |
GO | |
-- Create Subsidiaries as Edge table | |
CREATE TABLE dbo.Subsidiaries | |
( | |
HoldingPercentage DECIMAL(5,2), | |
EffectiveDate DATE | |
) AS EDGE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment