USE [Resources02_Def]
GO

IF NOT EXISTS( SELECT * FROM [dbo].[tblSystemCustomQueries] WHERE [nID]=70 )
	INSERT [dbo].[tblSystemCustomQueries] ([nID], [tName], [tCaption], [nParentTableID], [fFieldsChanged], [nDefaultSort], [nDefaultLayout]) 
	VALUES (70, N'Available$for$Reservation', N'Available for Reservation', 6, 2, NULL, 17)
GO

IF NOT EXISTS( SELECT * FROM [dbo].[tblSystemCustomQueries] WHERE [nID]=71 )
	INSERT [dbo].[tblSystemCustomQueries] ([nID], [tName], [tCaption], [nParentTableID], [fFieldsChanged], [nDefaultSort], [nDefaultLayout]) 
	VALUES (71, N'Reserved', N'Reserved', 6, 2, NULL, 17)
GO

IF NOT EXISTS( SELECT * FROM [dbo].[tblSystemCustomQueries] WHERE [nID]=72 )
	INSERT [dbo].[tblSystemCustomQueries] ([nID], [tName], [tCaption], [nParentTableID], [fFieldsChanged], [nDefaultSort], [nDefaultLayout]) 
	VALUES (72, N'Software$Allocated$to$License$Servers', N'Software Allocated to License Servers', 6, 2, NULL, 17)
GO

UPDATE tblSystemCustomQueries SET nDefaultLayout=17 WHERE nID=9 AND nDefaultLayout IS NULL
UPDATE tblSystemCustomQueries SET nDefaultLayout=17 WHERE nID=68 AND nDefaultLayout IS NULL
GO

