--**************************************************************************************************
--*
--*	This script will drop the security views when partitioning WinProj tables to another SQL Server
--*
--*	Privileges needed: member of db_owner or db_ddladmin
--*
--**************************************************************************************************

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSIGNMENT_BASELINES_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSIGNMENT_BASELINES_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSIGNMENT_BASELINES_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSIGNMENT_BASELINES_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSIGNMENTS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSIGNMENTS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSIGNMENTS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSIGNMENTS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSN_ENTERPRISE_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSN_ENTERPRISE_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSN_ENTERPRISE_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSN_ENTERPRISE_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ATTRIBUTE_STRINGS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ATTRIBUTE_STRINGS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ATTRIBUTE_STRINGS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ATTRIBUTE_STRINGS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_AVAILABILITY_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_AVAILABILITY_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_AVAILABILITY_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_AVAILABILITY_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CALENDAR_DATA_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CALENDAR_DATA_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CALENDAR_DATA_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CALENDAR_DATA_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CALENDARS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CALENDARS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CALENDARS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CALENDARS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CODE_FIELDS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CODE_FIELDS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CODE_FIELDS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CODE_FIELDS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CONVERSIONS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CONVERSIONS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CONVERSIONS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CONVERSIONS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_DATE_FIELDS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_DATE_FIELDS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_DATE_FIELDS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_DATE_FIELDS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_DURATION_FIELDS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_DURATION_FIELDS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_DURATION_FIELDS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_DURATION_FIELDS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_FIELD_ATTRIBUTES_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_FIELD_ATTRIBUTES_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_FIELD_ATTRIBUTES_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_FIELD_ATTRIBUTES_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_FLAG_FIELDS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_FLAG_FIELDS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_FLAG_FIELDS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_FLAG_FIELDS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_LINKS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_LINKS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_LINKS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_LINKS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_NUMBER_FIELDS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_NUMBER_FIELDS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_NUMBER_FIELDS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_NUMBER_FIELDS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_OUTLINE_CODES_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_OUTLINE_CODES_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_OUTLINE_CODES_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_OUTLINE_CODES_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_PROJECTS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_PROJECTS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_PROJECTS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_PROJECTS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RES_GLOBAL_BINARY_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RES_GLOBAL_BINARY_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RES_GLOBAL_BINARY_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RES_GLOBAL_BINARY_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCE_BASELINES_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCE_BASELINES_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCE_BASELINES_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCE_BASELINES_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCE_RATES_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCE_RATES_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCE_RATES_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCE_RATES_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCES_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCES_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCES_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCES_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_STRING_TYPES_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_STRING_TYPES_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_STRING_TYPES_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_STRING_TYPES_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TASK_BASELINES_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TASK_BASELINES_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TASK_BASELINES_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TASK_BASELINES_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TASKS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TASKS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TASKS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TASKS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TEXT_FIELDS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TEXT_FIELDS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TEXT_FIELDS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TEXT_FIELDS_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TIMEPHASED_DATA_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TIMEPHASED_DATA_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TIMEPHASED_DATA_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TIMEPHASED_DATA_PROJ_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSIGNMENTS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSIGNMENTS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSIGNMENTS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSIGNMENTS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSN_ENTERPRISE_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSN_ENTERPRISE_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSN_ENTERPRISE_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSN_ENTERPRISE_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSIGNMENT_BASELINES_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSIGNMENT_BASELINES_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ASSIGNMENT_BASELINES_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ASSIGNMENT_BASELINES_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ATTRIBUTE_STRINGS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ATTRIBUTE_STRINGS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_ATTRIBUTE_STRINGS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_ATTRIBUTE_STRINGS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_AVAILABILITY_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_AVAILABILITY_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_AVAILABILITY_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_AVAILABILITY_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CALENDAR_DATA_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CALENDAR_DATA_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CALENDAR_DATA_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CALENDAR_DATA_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CALENDARS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CALENDARS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CALENDARS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CALENDARS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CODE_FIELDS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CODE_FIELDS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CODE_FIELDS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CODE_FIELDS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CONVERSIONS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CONVERSIONS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_CONVERSIONS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_CONVERSIONS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_DATE_FIELDS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_DATE_FIELDS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_DATE_FIELDS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_DATE_FIELDS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_DURATION_FIELDS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_DURATION_FIELDS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_DURATION_FIELDS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_DURATION_FIELDS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_FIELD_ATTRIBUTES_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_FIELD_ATTRIBUTES_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_FIELD_ATTRIBUTES_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_FIELD_ATTRIBUTES_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_FLAG_FIELDS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_FLAG_FIELDS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_FLAG_FIELDS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_FLAG_FIELDS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_LINKS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_LINKS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_LINKS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_LINKS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_NUMBER_FIELDS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_NUMBER_FIELDS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_NUMBER_FIELDS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_NUMBER_FIELDS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_OUTLINE_CODES_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_OUTLINE_CODES_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_OUTLINE_CODES_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_OUTLINE_CODES_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_PROJECTS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_PROJECTS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_PROJECTS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_PROJECTS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RES_GLOBAL_BINARY_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RES_GLOBAL_BINARY_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RES_GLOBAL_BINARY_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RES_GLOBAL_BINARY_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCE_BASELINES_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCE_BASELINES_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCE_BASELINES_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCE_BASELINES_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCE_RATES_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCE_RATES_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCE_RATES_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCE_RATES_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCES_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCES_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_RESOURCES_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_RESOURCES_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_STRING_TYPES_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_STRING_TYPES_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_STRING_TYPES_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_STRING_TYPES_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TASK_BASELINES_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TASK_BASELINES_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TASK_BASELINES_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TASK_BASELINES_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TASKS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TASKS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TASKS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TASKS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TEXT_FIELDS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TEXT_FIELDS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TEXT_FIELDS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TEXT_FIELDS_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TIMEPHASED_DATA_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TIMEPHASED_DATA_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_TIMEPHASED_DATA_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_TIMEPHASED_DATA_RES_WRITEVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_MV_FIELDS_PROJ_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_MV_FIELDS_PROJ_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_MV_FIELDS_PROJ_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_MV_FIELDS_PROJ_WRITEVIEW]
GO
 
if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_MV_FIELDS_RES_READVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_MV_FIELDS_RES_READVIEW]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[MSP_MV_FIELDS_RES_WRITEVIEW]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[MSP_MV_FIELDS_RES_WRITEVIEW]
GO


 
-- End of script
 

 

 

