USE [HelpDesk02_Def]
GO
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Subcategory')
BEGIN
CREATE TABLE [dbo].[Subcategory](
	[nID] [int] NOT NULL,
	[nChoiceID] [int] NULL,
	[tName] [varchar](255) NULL,
 CONSTRAINT [PK_Subcategory] PRIMARY KEY CLUSTERED 
(
	[nID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, 
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END

GO
IF NOT EXISTS(SELECT * FROM [Subcategory] WHERE nID=1)
	INSERT [dbo].[Subcategory] ([nID], [nChoiceID], [tName]) 
	VALUES (1, 1, N'Hardware Incident 1');
IF NOT EXISTS(SELECT * FROM [Subcategory] WHERE nID=2)
	INSERT [dbo].[Subcategory] ([nID], [nChoiceID], [tName]) 
	VALUES (2, 2, N'Hardware Incident 2');
IF NOT EXISTS(SELECT * FROM [Subcategory] WHERE nID=3)
	INSERT [dbo].[Subcategory] ([nID], [nChoiceID], [tName]) 
	VALUES (3, 3, N'Network Incident 1');
IF NOT EXISTS(SELECT * FROM [Subcategory] WHERE nID=4)
	INSERT [dbo].[Subcategory] ([nID], [nChoiceID], [tName]) 
	VALUES (4, 4, N'Network Incident 2');
IF NOT EXISTS(SELECT * FROM [Subcategory] WHERE nID=5)
	INSERT [dbo].[Subcategory] ([nID], [nChoiceID], [tName]) 
	VALUES (5, 5, N'Software Incident 1');
