USE [HelpDesk02_Def]
GO
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'tblApprovalPath_User')
BEGIN
	CREATE TABLE [dbo].[tblApprovalPath_User](
		[nID] [int] NOT NULL,
		[nUserID] [int] NOT NULL,
	 CONSTRAINT [PK_tblApprovalPath_User] PRIMARY KEY CLUSTERED 
	(
		[nID] ASC,
		[nUserID] 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 [tblApprovalPath_User] WHERE nID=1)
	INSERT [dbo].[tblApprovalPath_User] ([nID], [nUserID]) 
	VALUES (1, 0);
IF NOT EXISTS(SELECT * FROM [tblApprovalPath_User] WHERE nID=2)
	INSERT [dbo].[tblApprovalPath_User] ([nID], [nUserID]) 
	VALUES (2, -39);
IF NOT EXISTS(SELECT * FROM [tblApprovalPath_User] WHERE nID=3)
	INSERT [dbo].[tblApprovalPath_User] ([nID], [nUserID]) 
	VALUES (3, -39);
IF NOT EXISTS(SELECT * FROM [tblApprovalPath_User] WHERE nID=4)
	INSERT [dbo].[tblApprovalPath_User] ([nID], [nUserID]) 
	VALUES (4, -33);
