Incomplete Leo

Something from my heart

NodeClicker 1.0 alpha RELEASED

Download and Rename to .zip

This is a project about developing a tool for building a graph data, including node, arc, direction, weight … and other related information. These data will be used in other graph related software, supporting for demonstration of graph theory in education.

Store procedure is included in attchment.

Create database script

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_Arcs_Nodes]’) and OBJECTPROPERTY(id, N’IsForeignKey’) = 1)
ALTER TABLE [dbo].[Arcs] DROP CONSTRAINT FK_Arcs_Nodes
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_Arcs_Nodes1]’) and OBJECTPROPERTY(id, N’IsForeignKey’) = 1)
ALTER TABLE [dbo].[Arcs] DROP CONSTRAINT FK_Arcs_Nodes1
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Arcs]’) and OBJECTPROPERTY(id, N’IsUserTable’) = 1)
drop table [dbo].[Arcs]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Nodes]’) and OBJECTPROPERTY(id, N’IsUserTable’) = 1)
drop table [dbo].[Nodes]
GO

CREATE TABLE [dbo].[Arcs] (
[FromId] [bigint] NOT NULL ,
[ToId] [bigint] NOT NULL ,
[Length] [bigint] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Nodes] (
[NodeId] [bigint] IDENTITY (1000, 1) NOT NULL ,
[Name] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Arcs] WITH NOCHECK ADD
CONSTRAINT [PK_Table1] PRIMARY KEY CLUSTERED
(
[FromId],
[ToId]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Nodes] WITH NOCHECK ADD
CONSTRAINT [PK_Nodes] PRIMARY KEY CLUSTERED
(
[NodeId]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Arcs] ADD
CONSTRAINT [FK_Arcs_Nodes] FOREIGN KEY
(
[FromId]
) REFERENCES [dbo].[Nodes] (
[NodeId]
),
CONSTRAINT [FK_Arcs_Nodes1] FOREIGN KEY
(
[ToId]
) REFERENCES [dbo].[Nodes] (
[NodeId]
)
GO

Advertisements

Tháng Một 28, 2007 Posted by | .NET Winform-based | %(count) bình luận