USE [censusweb_mdb]
GO

IF NOT EXISTS( SELECT * FROM [dbo].[tblQuery] WHERE [nViewID]=74 AND [nQueryID]=67 )
	INSERT [dbo].[tblQuery] ([nViewID], [nQueryID], [nStatus]) VALUES (74, 67, 2)
GO

IF NOT EXISTS( SELECT * FROM [dbo].[tblQuery] WHERE [nViewID]=74 AND [nQueryID]=68 )
	INSERT [dbo].[tblQuery] ([nViewID], [nQueryID], [nStatus]) VALUES (74, 68, 2)
GO

IF NOT EXISTS( SELECT * FROM [dbo].[tblQuery] WHERE [nViewID]=87 AND [nQueryID]=1 )
	INSERT [dbo].[tblQuery] ([nViewID], [nQueryID], [nStatus]) VALUES (87, 1, 2)
GO

IF NOT EXISTS( SELECT * FROM [dbo].[tblQuery] WHERE [nViewID]=87 AND [nQueryID]=2 )
	INSERT [dbo].[tblQuery] ([nViewID], [nQueryID], [nStatus]) VALUES (87, 2, 2)
GO

UPDATE tblQuery SET nQueryID=66 WHERE nQueryID=11 AND nViewID=44
GO

